javax.batch.api.chunk.listener
Class AbstractItemProcessListener<T,R>

java.lang.Object
  extended by javax.batch.api.chunk.listener.AbstractItemProcessListener<T,R>
Type Parameters:
T - specifies the item type read by the ItemProcessor paired with this ItemProcessListener.
R - specifies the item type returned by the ItemProcessor paired with this ItemProcessListener.
All Implemented Interfaces:
ItemProcessListener<T,R>

public abstract class AbstractItemProcessListener<T,R>
extends Object
implements ItemProcessListener<T,R>

The AbstractItemProcessListener provides default implementations of less commonly implemented methods.


Constructor Summary
AbstractItemProcessListener()
           
 
Method Summary
 void afterProcess(T item, R result)
          Override this method if the ItemProcessListener will do something after the item is processed.
 void beforeProcess(T item)
          Override this method if the ItemProcessListener will do something before the item is processed.
 void onProcessError(T item, Exception ex)
          Override this method if the ItemProcessListener will do something when the ItemProcessor processItem method throws an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractItemProcessListener

public AbstractItemProcessListener()
Method Detail

beforeProcess

public void beforeProcess(T item)
                   throws Exception
Override this method if the ItemProcessListener will do something before the item is processed. The default implementation does nothing.

Specified by:
beforeProcess in interface ItemProcessListener<T,R>
Parameters:
item - specifies the item about to be processed.
Throws:
Exception - (or subclass) if an error occurs.

afterProcess

public void afterProcess(T item,
                         R result)
                  throws Exception
Override this method if the ItemProcessListener will do something after the item is processed. The default implementation does nothing.

Specified by:
afterProcess in interface ItemProcessListener<T,R>
Parameters:
item - specifies the item about to be processed.
result - specifies the item to pass to the item writer.
Throws:
Exception - (or subclass) if an error occurs.

onProcessError

public void onProcessError(T item,
                           Exception ex)
                    throws Exception
Override this method if the ItemProcessListener will do something when the ItemProcessor processItem method throws an exception. The default implementation does nothing.

Specified by:
onProcessError in interface ItemProcessListener<T,R>
Parameters:
item - specifies the item about to be processed.
ex - specifies the exception thrown by the item processor.
Throws:
Exception - (or subclass) if an error occurs.


Copyright © 2013. All Rights Reserved.