Class SimpleStepBuilder<I,​O>

    • Constructor Detail

      • SimpleStepBuilder

        public SimpleStepBuilder​(StepBuilderHelper<?> parent)
        Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.
        Parameters:
        parent - a parent helper containing common step properties
      • SimpleStepBuilder

        protected SimpleStepBuilder​(SimpleStepBuilder<I,​O> parent)
        Create a new builder initialized with any properties in the parent. The parent is copied, so it can be re-used.
        Parameters:
        parent - a parent helper containing common step properties
    • Method Detail

      • registerStepListenerAsItemListener

        protected void registerStepListenerAsItemListener()
      • chunk

        public SimpleStepBuilder<I,​O> chunk​(int chunkSize)
        Sets the chunk size or commit interval for this step. This is the maximum number of items that will be read before processing starts in a single transaction. Not compatible with completionPolicy .
        Parameters:
        chunkSize - the chunk size (a.k.a commit interval)
        Returns:
        this for fluent chaining
      • chunk

        public SimpleStepBuilder<I,​O> chunk​(CompletionPolicy completionPolicy)
        Sets a completion policy for the chunk processing. Items are read until this policy determines that a chunk is complete, giving more control than with just the chunk size (or commit interval).
        Parameters:
        completionPolicy - a completion policy for the chunk
        Returns:
        this for fluent chaining
      • processor

        public SimpleStepBuilder<I,​O> processor​(java.util.function.Function<? super I,​? extends O> function)
        A Function to be delegated to as an ItemProcessor. If this is set, it will take precedence over any ItemProcessor configured via processor(ItemProcessor).
        Parameters:
        function - the function to delegate item processing to
        Returns:
        this for fluent chaining
      • readerIsTransactionalQueue

        public SimpleStepBuilder<I,​O> readerIsTransactionalQueue()
        Sets a flag to say that the reader is transactional (usually a queue), which is to say that failed items might be rolled back and re-presented in a subsequent transaction. Default is false, meaning that the items are read outside a transaction and possibly cached.
        Returns:
        this for fluent chaining
      • listener

        public SimpleStepBuilder<I,​O> listener​(ItemReadListener<? super I> listener)
        Register an item reader listener.
        Parameters:
        listener - the listener to register
        Returns:
        this for fluent chaining
      • listener

        public SimpleStepBuilder<I,​O> listener​(ItemWriteListener<? super O> listener)
        Register an item writer listener.
        Parameters:
        listener - the listener to register
        Returns:
        this for fluent chaining
      • listener

        public SimpleStepBuilder<I,​O> listener​(ItemProcessListener<? super I,​? super O> listener)
        Register an item processor listener.
        Parameters:
        listener - the listener to register
        Returns:
        this for fluent chaining
      • chunkOperations

        public SimpleStepBuilder<I,​O> chunkOperations​(RepeatOperations repeatTemplate)
        Instead of a chunk size or completion policy you can provide a complete repeat operations instance that handles the iteration over the item reader.
        Parameters:
        repeatTemplate - a complete repeat template for the chunk
        Returns:
        this for fluent chaining
      • getReader

        protected ItemReader<? extends I> getReader()
      • getProcessor

        protected ItemProcessor<? super I,​? extends O> getProcessor()
      • getChunkSize

        protected int getChunkSize()
      • isReaderTransactionalQueue

        protected boolean isReaderTransactionalQueue()
      • getItemListeners

        protected java.util.Set<StepListener> getItemListeners()
      • getChunkCompletionPolicy

        protected CompletionPolicy getChunkCompletionPolicy()
        Returns:
        a CompletionPolicy consistent with the chunk size and injected policy (if present).
      • registerAsStreamsAndListeners

        protected void registerAsStreamsAndListeners​(ItemReader<? extends I> itemReader,
                                                     ItemProcessor<? super I,​? extends O> itemProcessor,
                                                     ItemWriter<? super O> itemWriter)