Class BufferedItemReader<R>

  • Type Parameters:
    R - the return type of the reader
    All Implemented Interfaces:
    javax.batch.api.chunk.ItemReader

    public abstract class BufferedItemReader<R>
    extends NoStateTypedItemReader<R>
    An ItemReader base class which provides a simple buffering mechanism. The intention is to have a single simple query in readAllItems() which first reads all the items and have this class handle the rest. This simple Reader doesn't provide any checkpointInfo (ItemReader.checkpointInfo()) as we only read the items in one go.
    • Constructor Detail

      • BufferedItemReader

        public BufferedItemReader()
    • Method Detail

      • readAllItems

        protected abstract Iterator<R> readAllItems()
        This methods need to return all the items to be read. We will 'cache' them and iterate through them until all the items got consumed.
        Returns:
        all the items to be read