Package org.springframework.batch.core.listener

# Class CompositeItemProcessListener<T,S>

java.lang.Object
org.springframework.batch.core.listener.CompositeItemProcessListener<T,S>

All Implemented Interfaces:
  `ItemProcessListener<T,S>`, `StepListener`

public class CompositeItemProcessListener<T,S> extends Object implements ItemProcessListener<T,S>

Author:
  Dave Syer, Mahmoud Ben Hassine

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompositeItemProcessListener()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterProcess(T item, S result)`
  Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
  `void`
  `beforeProcess(T item)`
  Call the registered listeners in order, respecting and prioritising those that implement `Ordered`.
  `void`
  `onProcessError(T item, Exception e)`
  Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
  `void`
  `register(ItemProcessListener<? super T,? super S> itemProcessorListener)`
  Register additional listener.
  `void`
  `setListeners(List<? extends ItemProcessListener<? super T,? super S>> itemProcessorListeners)`
  Public setter for the listeners.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CompositeItemProcessListener

    public CompositeItemProcessListener()

- ## Method Details

  - ### setListeners

    public void setListeners(List<? extends ItemProcessListener<? super T,? super S>> itemProcessorListeners)
    Public setter for the listeners.
    Parameters:
      `itemProcessorListeners` - list of `ItemProcessListener`s to be called when process events occur.

  - ### register

    public void register(ItemProcessListener<? super T,? super S> itemProcessorListener)
    Register additional listener.
    Parameters:
      `itemProcessorListener` - instance of `ItemProcessListener` to be registered.

  - ### afterProcess

    public void afterProcess(T item, @Nullable S result)
    Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
    Specified by:
      `afterProcess` in interface `ItemProcessListener<T,S>`
    Parameters:
      `item` - to be processed
      `result` - of processing
    See Also:
      - `ItemProcessListener.afterProcess(java.lang.Object, java.lang.Object)`

  - ### beforeProcess

    public void beforeProcess(T item)
    Call the registered listeners in order, respecting and prioritising those that implement `Ordered`.
    Specified by:
      `beforeProcess` in interface `ItemProcessListener<T,S>`
    Parameters:
      `item` - to be processed.
    See Also:
      - `ItemProcessListener.beforeProcess(java.lang.Object)`

  - ### onProcessError

    public void onProcessError(T item, Exception e)
    Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
    Specified by:
      `onProcessError` in interface `ItemProcessListener<T,S>`
    Parameters:
      `item` - attempted to be processed
      `e` - - exception thrown during processing.
    See Also:
      - `ItemProcessListener.onProcessError(java.lang.Object, java.lang.Exception)`