org.springframework.batch.core.listener

## Class CompositeItemReadListener<T>

- java.lang.Object
- - org.springframework.batch.core.listener.CompositeItemReadListener<T>

- All Implemented Interfaces:
    ItemReadListener<T>, StepListener

      public class CompositeItemReadListener<T>
      extends java.lang.Object
      implements ItemReadListener<T>

  Author:
    Lucas Ward, Dave Syer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeItemReadListener()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterRead(T item)` Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
    `void` | `beforeRead()` Call the registered listeners in order, respecting and prioritising those that implement `Ordered`.
    `void` | `onReadError(java.lang.Exception ex)` Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
    `void` | `register(ItemReadListener<? super T> itemReaderListener)` Register additional listener.
    `void` | `setListeners(java.util.List<? extends ItemReadListener<? super T>> 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

    - #### CompositeItemReadListener

          public CompositeItemReadListener()

  - ### Method Detail

    - #### setListeners

          public void setListeners(java.util.List<? extends ItemReadListener<? super T>> itemReadListeners)

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

    - #### register

          public void register(ItemReadListener<? super T> itemReaderListener)

      Register additional listener.
      Parameters:
        `itemReaderListener` -

    - #### afterRead

          public void afterRead(T item)

      Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
      Specified by:
        `afterRead` in interface `ItemReadListener<T>`
      Parameters:
        `item` - returned from read()
      See Also:
        `ItemReadListener.afterRead(java.lang.Object)`

    - #### beforeRead

          public void beforeRead()

      Call the registered listeners in order, respecting and prioritising those that implement `Ordered`.
      Specified by:
        `beforeRead` in interface `ItemReadListener<T>`
      See Also:
        `ItemReadListener.beforeRead()`

    - #### onReadError

          public void onReadError(java.lang.Exception ex)

      Call the registered listeners in reverse order, respecting and prioritising those that implement `Ordered`.
      Specified by:
        `onReadError` in interface `ItemReadListener<T>`
      Parameters:
        `ex` - thrown from `ItemWriter`
      See Also:
        `ItemReadListener.onReadError(java.lang.Exception)`