Class CompositeExceptionHandler
java.lang.Object
org.springframework.batch.repeat.exception.CompositeExceptionHandler
- All Implemented Interfaces:
ExceptionHandler
Composite
ExceptionHandler
that loops though a list of delegates.- Author:
- Dave Syer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleException
(RepeatContext context, Throwable throwable) Iterate over the handlers delegating the call to each in turn.void
setHandlers
(ExceptionHandler[] handlers)
-
Constructor Details
-
CompositeExceptionHandler
public CompositeExceptionHandler()
-
-
Method Details
-
setHandlers
-
handleException
Iterate over the handlers delegating the call to each in turn. The chain ends if an exception is thrown.- Specified by:
handleException
in interfaceExceptionHandler
- 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:
Throwable
- implementations are free to re-throw the exception- See Also:
-