javax.batch.api.chunk.listener
Interface ItemProcessListener<T,R>

Type Parameters:
T - specifies the type processed by an item processor.
R - specifies the type returned by an item processor.
All Known Implementing Classes:
AbstractItemProcessListener

public interface ItemProcessListener<T,R>

ItemProcessListener intercepts item processing.


Method Summary
 void afterProcess(T item, R result)
          The afterProcess method that receives control after an item processor processes an item.
 void beforeProcess(T item)
          The beforeProcess method that receives control before an item processor is called to process the next item.
 void onProcessError(T item, Exception ex)
          The onProcessError a method that receives control after an item processor throws an exception.
 

Method Detail

beforeProcess

void beforeProcess(T item)
                   throws Exception
The beforeProcess method that receives control before an item processor is called to process the next item. The method receives the item to be processed as an input.

Parameters:
item - specifies the item about to be processed.
Throws:
Exception - if an error occurs.

afterProcess

void afterProcess(T item,
                  R result)
                  throws Exception
The afterProcess method that receives control after an item processor processes an item. The method receives the item processed and the result item as an input.

Parameters:
item - specifies the item about to be processed.
result - specifies the item to pass to the item writer.
Throws:
Exception - if an error occurs.

onProcessError

void onProcessError(T item,
                    Exception ex)
                    throws Exception
The onProcessError a method that receives control after an item processor throws an exception. This method receives the exception and the input item.

Parameters:
item - specifies the item about to be processed.
ex - specifies the exception thrown by the item processor.
Throws:
Exception


Copyright © 2013. All Rights Reserved.