org.springframework.batch.core.step.item
Class SimpleRetryExceptionHandler

java.lang.Object
  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

Author:
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

SimpleRetryExceptionHandler

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

handleException

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
Parameters:
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.
Throws:
Throwable - implementations are free to re-throw the exception

close

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
Overrides:
close in class RetryListenerSupport
Parameters:
context - the current RetryContext.
callback - the current RetryCallback.
throwable - the last exception that was thrown by the callback.


Copyright © 2008 SpringSource. All Rights Reserved.