use of org.asynchttpclient.filter.IOExceptionFilter in project async-http-client by AsyncHttpClient.
the class NettyRequestSender method applyIoExceptionFiltersAndReplayRequest.
public boolean applyIoExceptionFiltersAndReplayRequest(NettyResponseFuture<?> future, IOException e, Channel channel) {
boolean replayed = false;
@SuppressWarnings({ "unchecked", "rawtypes" }) FilterContext<?> fc = new FilterContext.FilterContextBuilder().asyncHandler(future.getAsyncHandler()).request(future.getCurrentRequest()).ioException(e).build();
for (IOExceptionFilter asyncFilter : config.getIoExceptionFilters()) {
try {
fc = asyncFilter.filter(fc);
assertNotNull(fc, "filterContext");
} catch (FilterException efe) {
abort(channel, future, efe);
}
}
if (fc.replayRequest() && future.incrementRetryAndCheck() && future.isReplayPossible()) {
replayRequest(future, fc, channel);
replayed = true;
}
return replayed;
}
Aggregations