Class SimpleChunkProvider<I>

    • Field Detail

      • logger

        protected final org.apache.commons.logging.Log logger
      • itemReader

        protected final ItemReader<? extends I> itemReader
    • Constructor Detail

    • Method Detail

      • setListeners

        public void setListeners​(java.util.List<? extends StepListener> listeners)
        Register some StepListeners with the handler. Each will get the callbacks in the order specified at the correct stage.
        Parameters:
        listeners - list of StepListeners.
      • registerListener

        public void registerListener​(StepListener listener)
        Register a listener for callbacks at the appropriate stages in a process.
        Parameters:
        listener - a StepListener
      • doRead

        @Nullable
        protected final I doRead()
                          throws java.lang.Exception
        Surrounds the read call with listener callbacks.
        Returns:
        the item or null if the data source is exhausted
        Throws:
        java.lang.Exception - is thrown if error occurs during read.
      • read

        @Nullable
        protected I read​(StepContribution contribution,
                         Chunk<I> chunk)
                  throws SkipOverflowException,
                         java.lang.Exception
        Delegates to doRead(). Subclasses can add additional behaviour (e.g. exception handling).
        Parameters:
        contribution - the current step execution contribution
        chunk - the current chunk
        Returns:
        a new item for processing or null if the data source is exhausted
        Throws:
        SkipOverflowException - if specifically the chunk is accumulating too much data (e.g. skips) and it wants to force a commit.
        java.lang.Exception - if there is a generic issue