org.springframework.batch.sample.common
Class InfiniteLoopReader

java.lang.Object
  extended by org.springframework.batch.sample.common.InfiniteLoopReader
All Implemented Interfaces:
ItemReader<Object>

public class InfiniteLoopReader
extends Object
implements ItemReader<Object>

ItemReader implementation that will continually return a new object. It's generally useful for testing interruption.

Author:
Lucas Ward

Constructor Summary
InfiniteLoopReader()
           
 
Method Summary
 Object read()
          Reads a piece of input data and advance to the next one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfiniteLoopReader

public InfiniteLoopReader()
Method Detail

read

public Object read()
            throws Exception,
                   UnexpectedInputException,
                   ParseException
Description copied from interface: ItemReader
Reads a piece of input data and advance to the next one. Implementations must return null at the end of the input data set. In a transactional setting, caller might get the same item twice from successive calls (or otherwise), if the first call was in a transaction that rolled back.

Specified by:
read in interface ItemReader<Object>
Throws:
Exception - if an underlying resource is unavailable.
UnexpectedInputException
ParseException


Copyright © 2009 SpringSource. All Rights Reserved.