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

# Class EventEmittingItemProcessListener

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

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

public class EventEmittingItemProcessListener extends Object implements org.springframework.batch.core.ItemProcessListener, org.springframework.core.Ordered
Provides informational messages around the `ItemProcessListener` of a batch job. The `ItemProcessListener.beforeProcess(Object)` of this listener is a no-op. `ItemProcessListener.afterProcess(Object, Object)` returns a message if an item was filtered (`ItemProcessor` returned null), if the result of the processor was equal to the input (via `.equals`), or if they were not equal. `ItemProcessListener.onProcessError(Object, Exception)` provides the exception via the `BatchJobHeaders.BATCH_EXCEPTION` message header.

Author:
  Michael Minella, Glenn Renfro, Ali Shahbour

- ## Field Summary

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

  `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterProcess(Object item, Object result)`
  `void`
  `beforeProcess(Object item)`
  `int`
  `getOrder()`
  `void`
  `onProcessError(Object item, Exception e)`

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

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

- ## Constructor Details

  - ### EventEmittingItemProcessListener

    public EventEmittingItemProcessListener(MessagePublisher messagePublisher, TaskEventProperties properties)

  - ### EventEmittingItemProcessListener

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

- ## Method Details

  - ### beforeProcess

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

  - ### afterProcess

    public void afterProcess(Object item, Object result)
    Specified by:
      `afterProcess` in interface `org.springframework.batch.core.ItemProcessListener`

  - ### onProcessError

    public void onProcessError(Object item, Exception e)
    Specified by:
      `onProcessError` in interface `org.springframework.batch.core.ItemProcessListener`

  - ### getOrder

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