Package 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 Object implements ItemReadListener<T>

Author:
  Lucas Ward, Dave Syer

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompositeItemReadListener()`

- ## Method Summary

  Modifier and Type
  Method
  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(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(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 Details

  - ### CompositeItemReadListener

    public CompositeItemReadListener()

- ## Method Details

  - ### setListeners

    public void setListeners(List<? extends ItemReadListener<? super T>> itemReadListeners)
    Public setter for the listeners.
    Parameters:
      `itemReadListeners` - list of `ItemReadListener`s to be called when read events occur.

  - ### register

    public void register(ItemReadListener<? super T> itemReaderListener)
    Register additional listener.
    Parameters:
      `itemReaderListener` - instance of `ItemReadListener` to be registered.

  - ### 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(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 `ItemReader`
    See Also:
      - `ItemReadListener.onReadError(java.lang.Exception)`