Interface ExceptionHandler
- All Known Implementing Classes:
CompositeExceptionHandler,DefaultExceptionHandler,FootballExceptionHandler,LogOrRethrowExceptionHandler,RethrowOnThresholdExceptionHandler,SimpleLimitExceptionHandler,SimpleRetryExceptionHandler
public interface ExceptionHandlerHandler to allow strategies for re-throwing exceptions. Normally aCompletionPolicywill be used to decide whether to end a batch when there is no exception, and theExceptionHandleris used to signal an abnormal ending - an abnormal ending would result in anExceptionHandlerthrowing an exception. The caller will catch and re-throw it if necessary.- Author:
- Dave Syer, Robert Kasanicky
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandleException(RepeatContext context, java.lang.Throwable throwable)Deal with a Throwable during a batch - decide whether it should be re-thrown in the first place.
Method Detail
handleException
void handleException(RepeatContext context, java.lang.Throwable throwable) throws java.lang.Throwable
Deal with a Throwable during a batch - decide whether it should be re-thrown in the first place.- Parameters:
context- the currentRepeatContext. 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:
java.lang.Throwable- implementations are free to re-throw the exception