javax.batch.api.chunk.listener
Class AbstractItemReadListener<T>

java.lang.Object
  extended by javax.batch.api.chunk.listener.AbstractItemReadListener<T>
Type Parameters:
T - specifies the item type read by the ItemReader paired with this ItemReadListener.
All Implemented Interfaces:
ItemReadListener<T>

public abstract class AbstractItemReadListener<T>
extends Object
implements ItemReadListener<T>

The AbstractItemReadListener provides default implementations of less commonly implemented methods.


Constructor Summary
AbstractItemReadListener()
           
 
Method Summary
 void afterRead(T item)
          Override this method if the ItemReadListener will do something after the item is read.
 void beforeRead()
          Override this method if the ItemReadListener will do something before the item is read.
 void onReadError(Exception ex)
          Override this method if the ItemReadListener will do something when the ItemReader readItem method throws an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractItemReadListener

public AbstractItemReadListener()
Method Detail

beforeRead

public void beforeRead()
                throws Exception
Override this method if the ItemReadListener will do something before the item is read. The default implementation does nothing.

Specified by:
beforeRead in interface ItemReadListener<T>
Throws:
Exception - (or subclass) if an error occurs.

afterRead

public void afterRead(T item)
               throws Exception
Override this method if the ItemReadListener will do something after the item is read. The default implementation does nothing.

Specified by:
afterRead in interface ItemReadListener<T>
Parameters:
item - specifies the item read by the item reader.
Throws:
Exception - (or subclass) if an error occurs.

onReadError

public void onReadError(Exception ex)
                 throws Exception
Override this method if the ItemReadListener will do something when the ItemReader readItem method throws an exception. The default implementation does nothing.

Specified by:
onReadError in interface ItemReadListener<T>
Parameters:
ex - specifies the exception that occurred in the item reader.
Throws:
Exception - (or subclass) if an error occurs.


Copyright © 2013. All Rights Reserved.