Source:
private InputStream processExec(CallContextImpl callContext) { final int DEFAULT_MAX_RETRIES = 10; ErrorDisposition error = ErrorDisposition.RETRY; InputStream output = null; for (int retryCount = 0; retryCount < DEFAULT_MAX_RETRIES && error == ErrorDisposition.RETRY; retryCount++) { Throwable throwable = null; try { logger.trace("exec calling endpoint={} count={} state={}", callContext.getEndpoint().getEndpointPath(), getCallCount(), callContext.getEndpointState()); output = getEndpoint().getCaller().call( callContext.getClient(), callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit() ); if (callContext.getEndpoint().allowsEndpointState()) { callContext.withEndpointState(output); } incrementCallCount(); return output; } catch(Throwable catchedThrowable) { throwable = catchedThrowable; } if (throwable != null) { if (getErrorListener() == null) { logger.error("Error while calling " + getEndpoint().getEndpointPath(), throwable); throw new RuntimeException("Error while calling " + getEndpoint().getEndpointPath(), throwable); } else { try { if (retryCount < DEFAULT_MAX_RETRIES - 1) { error = getErrorListener().processError(retryCount, throwable, callContext); } else { error = ErrorDisposition.SKIP_CALL; } } catch (Throwable throwable1) { logger.error("Error Listener failed with " , throwable1); error = ErrorDisposition.STOP_ALL_CALLS; } switch (error) { case RETRY: continue; case SKIP_CALL: if(callContext.getEndpoint().allowsEndpointState()) { callContext.withEndpointState((InputStream) null); } return output; case STOP_ALL_CALLS: getCallerThreadPoolExecutor().shutdown(); } } } } return output; }

Target:
private InputStream processExec(CallContextImpl callContext) { ErrorDisposition error = ErrorDisposition.RETRY; InputStream output = null; for (int retryCount = 0; retryCount < DEFAULT_MAX_RETRIES && error == ErrorDisposition.RETRY; retryCount++) { Throwable throwable = null; try { logger.trace("exec calling endpoint={} count={} state={}", callContext.getEndpoint().getEndpointPath(), getCallCount(), callContext.getEndpointState()); output = getEndpoint().getCaller().call( callContext.getClient(), callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit() ); if (callContext.getEndpoint().allowsEndpointState()) { callContext.withEndpointState(output); } incrementCallCount(); return output; } catch(Throwable catchedThrowable) { throwable = catchedThrowable; } if (throwable != null) { if (getErrorListener() == null) { logger.error("No error listener set. Stop all calls. " + getEndpoint().getEndpointPath(), throwable); error = ErrorDisposition.STOP_ALL_CALLS; } else { try { if (retryCount < DEFAULT_MAX_RETRIES - 1) { error = getErrorListener().processError(retryCount, throwable, callContext); } else { error = ErrorDisposition.SKIP_CALL; } } catch (Throwable throwable1) { logger.error("Error Listener failed with " , throwable1); error = ErrorDisposition.STOP_ALL_CALLS; } switch (error) { case RETRY: continue; case SKIP_CALL: if(callContext.getEndpoint().allowsEndpointState()) { callContext.withEndpointState((InputStream) null); } return output; case STOP_ALL_CALLS: getCallerThreadPoolExecutor().shutdown(); } } } } return output; }