Class SimpleRetryExceptionHandler

  extended by org.springframework.batch.retry.listener.RetryListenerSupport
      extended by org.springframework.batch.core.step.item.SimpleRetryExceptionHandler
All Implemented Interfaces:
ExceptionHandler, RetryListener

public class SimpleRetryExceptionHandler
extends RetryListenerSupport
implements ExceptionHandler

Dave Syer

Constructor Summary
SimpleRetryExceptionHandler(RetryPolicy retryPolicy, ExceptionHandler exceptionHandler, Class[] classes)
Method Summary
 void close(RetryContext context, RetryCallback callback, Throwable throwable)
          Called after the final attempt (successful or not).
 void handleException(RepeatContext context, Throwable throwable)
          Deal with a Throwable during a batch - decide whether it should be re-thrown in the first place.
Methods inherited from class org.springframework.batch.retry.listener.RetryListenerSupport
onError, open
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public SimpleRetryExceptionHandler(RetryPolicy retryPolicy,
                                   ExceptionHandler exceptionHandler,
                                   Class[] classes)
retryPolicy -
exceptionHandler -
classes -
Method Detail


public void handleException(RepeatContext context,
                            Throwable throwable)
                     throws Throwable
Description copied from interface: ExceptionHandler
Deal with a Throwable during a batch - decide whether it should be re-thrown in the first place.

Specified by:
handleException in interface ExceptionHandler
context - the current RepeatContext. Can be used to store state (via attributes), for example to count the number of occurrences of a particular exception type and implement a threshold policy.
throwable - an exception.
Throwable - implementations are free to re-throw the exception


public void close(RetryContext context,
                  RetryCallback callback,
                  Throwable throwable)
Description copied from interface: RetryListener
Called after the final attempt (successful or not). Allow the interceptor to clean up any resource it is holding before control returns to the retry caller.

Specified by:
close in interface RetryListener
close in class RetryListenerSupport
context - the current RetryContext.
callback - the current RetryCallback.
throwable - the last exception that was thrown by the callback.

Copyright © 2008 SpringSource. All Rights Reserved.