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 java.lang.Object
      implements ItemProcessListener<T,S>

  Author:
    Dave Syer, Mahmoud Ben Hassine

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeItemProcessListener()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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, java.lang.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(java.util.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 Detail

    - #### CompositeItemProcessListener

          public CompositeItemProcessListener()

  - ### Method Detail

    - #### setListeners

          public void setListeners(java.util.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,
                                     java.lang.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)`