public class SimpleRetryExceptionHandler
extends org.springframework.retry.listener.RetryListenerSupport
implements org.springframework.batch.repeat.exception.ExceptionHandler
ExceptionHandler that is aware of the retry context so that it can
distinguish between a fatal exception and one that can be retried. Delegates
the actual exception handling to another ExceptionHandler.| Constructor and Description |
|---|
SimpleRetryExceptionHandler(org.springframework.retry.RetryPolicy retryPolicy,
org.springframework.batch.repeat.exception.ExceptionHandler exceptionHandler,
java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> fatalExceptionClasses)
Create an exception handler from its mandatory properties.
|
| Modifier and Type | Method and Description |
|---|---|
<T,E extends java.lang.Throwable> |
close(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T,E> callback,
java.lang.Throwable throwable)
If retry is exhausted set up some state in the context that can be used
to signal that the exception should be handled.
|
void |
handleException(org.springframework.batch.repeat.RepeatContext context,
java.lang.Throwable throwable)
Check if the exception is going to be retried, and veto the handling if
it is.
|
public SimpleRetryExceptionHandler(org.springframework.retry.RetryPolicy retryPolicy,
org.springframework.batch.repeat.exception.ExceptionHandler exceptionHandler,
java.util.Collection<java.lang.Class<? extends java.lang.Throwable>> fatalExceptionClasses)
retryPolicy - the retry policy that will be under effect when an
exception is encounteredexceptionHandler - the delegate to use if an exception actually
needs to be handledfatalExceptionClasses - exceptionspublic void handleException(org.springframework.batch.repeat.RepeatContext context,
java.lang.Throwable throwable)
throws java.lang.Throwable
handleException in interface org.springframework.batch.repeat.exception.ExceptionHandlerjava.lang.ThrowableExceptionHandler.handleException(org.springframework.batch.repeat.RepeatContext,
java.lang.Throwable)public <T,E extends java.lang.Throwable> void close(org.springframework.retry.RetryContext context,
org.springframework.retry.RetryCallback<T,E> callback,
java.lang.Throwable throwable)
close in interface org.springframework.retry.RetryListenerclose in class org.springframework.retry.listener.RetryListenerSupportRetryListener.close(org.springframework.retry.RetryContext,
org.springframework.retry.RetryCallback, java.lang.Throwable)