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

- - ### 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> itemReaderListener)` Register additional listener.
    `void` | `setListeners(java.util.List<? extends ItemProcessListener<? super T,? super S>> itemReadListeners)` 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>> itemReadListeners)

      Public setter for the listeners.
      Parameters:
        `itemReadListeners` -

    - #### register

          public void register(ItemProcessListener<? super T,? super S> itemReaderListener)

      Register additional listener.
      Parameters:
        `itemReaderListener` -

    - #### afterProcess

          public void afterProcess(T item,
                                   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)`