Class JsrFaultTolerantChunkProcessor<I,​O>

  • Type Parameters:
    I - input type for the step
    O - output type for the step
    All Implemented Interfaces:
    ChunkProcessor<I>

    public class JsrFaultTolerantChunkProcessor<I,​O>
    extends JsrChunkProcessor<I,​O>
    Extension of the JsrChunkProcessor that adds skip and retry functionality.
    Author:
    Michael Minella, Chris Schaefer
    • Field Detail

      • logger

        protected final org.apache.commons.logging.Log logger
    • Method Detail

      • setSkipPolicy

        public void setSkipPolicy​(SkipPolicy skipPolicy)
        Parameters:
        skipPolicy - a SkipPolicy
      • setRollbackClassifier

        public void setRollbackClassifier​(org.springframework.classify.Classifier<java.lang.Throwable,​java.lang.Boolean> rollbackClassifier)
        Parameters:
        rollbackClassifier - a Classifier
      • 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.
        Overrides:
        setListeners in class JsrChunkProcessor<I,​O>
        Parameters:
        listeners - listeners to be registered
      • provide

        protected I provide​(StepContribution contribution,
                            Chunk<I> chunk)
                     throws java.lang.Exception
        Adds retry and skip logic to the reading phase of the chunk loop.
        Overrides:
        provide in class JsrChunkProcessor<I,​O>
        Parameters:
        contribution - a StepContribution
        chunk - a Chunk
        Returns:
        I an item
        Throws:
        java.lang.Exception - thrown if error occurs.
      • transform

        protected O transform​(StepContribution contribution,
                              I item)
                       throws java.lang.Exception
        Adds retry and skip logic to the process phase of the chunk loop.
        Overrides:
        transform in class JsrChunkProcessor<I,​O>
        Parameters:
        contribution - a StepContribution
        item - an item to be processed
        Returns:
        O an item that has been processed if a processor is available
        Throws:
        java.lang.Exception - thrown if error occurs.