org.springframework.batch.core.step.item
Class SimpleRetryExceptionHandler
java.lang.Object
org.springframework.batch.retry.listener.RetryListenerSupport
org.springframework.batch.core.step.item.SimpleRetryExceptionHandler
- All Implemented Interfaces:
- ExceptionHandler, RetryListener
public class SimpleRetryExceptionHandler
- extends RetryListenerSupport
- implements ExceptionHandler
- Author:
- Dave Syer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleRetryExceptionHandler
public SimpleRetryExceptionHandler(RetryPolicy retryPolicy,
ExceptionHandler exceptionHandler,
Class[] classes)
- Parameters:
retryPolicy
- exceptionHandler
- classes
-
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.