List of usage examples for org.springframework.batch.repeat RepeatListener onError
void onError(RepeatContext context, Throwable e);
From source file:org.springframework.batch.repeat.support.RepeatTemplate.java
private void doHandle(Throwable throwable, RepeatContext context, Collection<Throwable> deferred) { // An exception alone is not sufficient grounds for not // continuing Throwable unwrappedThrowable = unwrapIfRethrown(throwable); try {// w w w. j a v a 2 s. c o m for (int i = listeners.length; i-- > 0;) { RepeatListener interceptor = listeners[i]; // This is not an error - only log at debug // level. if (logger.isDebugEnabled()) { logger.debug("Exception intercepted (" + (i + 1) + " of " + listeners.length + ")", unwrappedThrowable); } interceptor.onError(context, unwrappedThrowable); } if (logger.isDebugEnabled()) { logger.debug("Handling exception: " + throwable.getClass().getName() + ", caused by: " + unwrappedThrowable.getClass().getName() + ": " + unwrappedThrowable.getMessage()); } exceptionHandler.handleException(context, unwrappedThrowable); } catch (Throwable handled) { deferred.add(handled); } }