Package org.springframework.cloud.task.batch.listener

# Class EventEmittingItemReadListener

java.lang.Object
org.springframework.cloud.task.batch.listener.EventEmittingItemReadListener

All Implemented Interfaces:
  `org.springframework.batch.core.ItemReadListener`, `org.springframework.batch.core.StepListener`, `org.springframework.core.Ordered`

public class EventEmittingItemReadListener extends Object implements org.springframework.batch.core.ItemReadListener, org.springframework.core.Ordered
Provides informational messages around the `ItemReader` of a batch job. The `ItemReadListener.beforeRead()` and `ItemReadListener.afterRead(Object)` are both no-ops in this implementation. `ItemReadListener.onReadError(Exception)` provides the exception via the `BatchJobHeaders.BATCH_EXCEPTION` message header.

Author:
  Glenn Renfro, Ali Shahbour

- ## Field Summary

  ### Fields inherited from interface org.springframework.core.Ordered

  `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EventEmittingItemReadListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties)`
  `EventEmittingItemReadListener(MessagePublisher messagePublisher, TaskEventProperties properties)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterRead(Object item)`
  `void`
  `beforeRead()`
  `int`
  `getOrder()`
  `void`
  `onReadError(Exception ex)`

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

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

- ## Constructor Details

  - ### EventEmittingItemReadListener

    public EventEmittingItemReadListener(MessagePublisher messagePublisher, TaskEventProperties properties)

  - ### EventEmittingItemReadListener

    public EventEmittingItemReadListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties)

- ## Method Details

  - ### beforeRead

    public void beforeRead()
    Specified by:
      `beforeRead` in interface `org.springframework.batch.core.ItemReadListener`

  - ### afterRead

    public void afterRead(Object item)
    Specified by:
      `afterRead` in interface `org.springframework.batch.core.ItemReadListener`

  - ### onReadError

    public void onReadError(Exception ex)
    Specified by:
      `onReadError` in interface `org.springframework.batch.core.ItemReadListener`

  - ### getOrder

    public int getOrder()
    Specified by:
      `getOrder` in interface `org.springframework.core.Ordered`