Package org.springframework.batch.core
Interface ItemProcessListener<T,S>
- All Superinterfaces:
StepListener
- All Known Implementing Classes:
CompositeItemProcessListener
,DefaultItemFailureHandler
,ItemListenerSupport
,MulticasterBatchListener
,StepListenerSupport
Listener interface for the processing of an item. Implementations
of this interface will be notified before and after an item is
passed to the
ItemProcessor
and in the event of any
exceptions thrown by the processor.- Author:
- Dave Syer, Mahmoud Ben Hassine
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
afterProcess
(T item, S result) Called afterItemProcessor.process(Object)
returns.default void
beforeProcess
(T item) Called beforeItemProcessor.process(Object)
.default void
onProcessError
(T item, Exception e) Called if an exception was thrown fromItemProcessor.process(Object)
.
-
Method Details
-
beforeProcess
Called beforeItemProcessor.process(Object)
.- Parameters:
item
- to be processed.
-
afterProcess
Called afterItemProcessor.process(Object)
returns. If the processor returnsnull
, this method will still be called, with a {code null} result, allowing for notification of 'filtered' items.- Parameters:
item
- to be processedresult
- of processing
-
onProcessError
Called if an exception was thrown fromItemProcessor.process(Object)
.- Parameters:
item
- attempted to be processede
- - exception thrown during processing.
-