Package org.springframework.batch.core
Interface ItemProcessListener<T,S>
- All Superinterfaces:
StepListener
- All Known Implementing Classes:
CompositeItemProcessListener
,DefaultItemFailureHandler
,ItemListenerSupport
,ItemProcessListenerAdapter
,MulticasterBatchListener
,StagingItemListener
,StepListenerSupport
public interface ItemProcessListener<T,S> extends StepListener
Listener interface for the processing of an item. Implementations of this interface will be notified before and after an item is passed to theItemProcessor
and in the event of any exceptions thrown by the processor.- Author:
- Dave Syer, Mahmoud Ben Hassine
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
afterProcess(T item, S result)
Called afterItemProcessor.process(Object)
returns.void
beforeProcess(T item)
Called beforeItemProcessor.process(Object)
.void
onProcessError(T item, java.lang.Exception e)
Called if an exception was thrown fromItemProcessor.process(Object)
.
Method Detail
beforeProcess
void beforeProcess(T item)
Called beforeItemProcessor.process(Object)
.- Parameters:
item
- to be processed.
afterProcess
void afterProcess(T item, @Nullable S result)
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
void onProcessError(T item, java.lang.Exception e)
Called if an exception was thrown fromItemProcessor.process(Object)
.- Parameters:
item
- attempted to be processede
- - exception thrown during processing.