Interface ItemProcessListener<T,S>

All Superinterfaces:
StepListener
All Known Implementing Classes:
CompositeItemProcessListener, DefaultItemFailureHandler, ItemListenerSupport, MulticasterBatchListener, StepListenerSupport

public interface ItemProcessListener<T,S> extends StepListener
Listener interface for the processing of an item. Implementations of this interface are notified before and after an item is passed to the ItemProcessor and in the event of any exceptions thrown by the processor.
Author:
Dave Syer, Mahmoud Ben Hassine
  • Method Details

    • beforeProcess

      default void beforeProcess(T item)
      Parameters:
      item - to be processed.
    • afterProcess

      default void afterProcess(T item, @Nullable S result)
      Called after ItemProcessor.process(Object) returns. If the processor returns null, this method is still called, with a null result, allowing for notification of "filtered" items.
      Parameters:
      item - to be processed
      result - of processing
    • onProcessError

      default void onProcessError(T item, Exception e)
      Called if an exception was thrown from ItemProcessor.process(Object).
      Parameters:
      item - attempted to be processed
      e - - exception thrown during processing.