org.springframework.batch.item.support
Class AbstractItemReader

java.lang.Object
  extended by org.springframework.batch.item.support.AbstractItemReader
All Implemented Interfaces:
ItemReader
Direct Known Subclasses:
DelegatingItemReader, ExampleItemReader, JmsItemReader, ListItemReader

public abstract class AbstractItemReader
extends Object
implements ItemReader

Base class for ItemReader implementations.

Author:
Dave Syer

Constructor Summary
AbstractItemReader()
           
 
Method Summary
 void mark()
          Mark the stream so that it can be reset later and the items backed out.
Mark is called before reading a new chunk of items - in case of rollback mark will not be called again before re-processing the chunk.
 void reset()
          Reset the stream to the last mark.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.batch.item.ItemReader
read
 

Constructor Detail

AbstractItemReader

public AbstractItemReader()
Method Detail

mark

public void mark()
          throws MarkFailedException
Description copied from interface: ItemReader
Mark the stream so that it can be reset later and the items backed out.
Mark is called before reading a new chunk of items - in case of rollback mark will not be called again before re-processing the chunk.

Specified by:
mark in interface ItemReader
Throws:
MarkFailedException - if there is a problem with the mark. If a mark fails inside a transaction, it would be worrying, but not normally fatal.

reset

public void reset()
           throws ResetFailedException
Description copied from interface: ItemReader
Reset the stream to the last mark. After a reset the stream state will be such that changes (items read or written) since the last call to mark will not be visible after a call to close.

Specified by:
reset in interface ItemReader
Throws:
ResetFailedException - if there is a problem with the reset. If a reset fails inside a transaction, it would normally be fatal, and would leave the stream in an inconsistent state. So while this is an unchecked exception, it may be important for a client to catch it explicitly.


Copyright © 2009 SpringSource. All Rights Reserved.