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

# Class EventEmittingChunkListener

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

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

public class EventEmittingChunkListener extends Object implements org.springframework.batch.core.ChunkListener, org.springframework.core.Ordered
Provides informational messages around the `Chunk` of a batch job. The `ChunkListener.beforeChunk(ChunkContext)` and `ChunkListener.afterChunk(ChunkContext)` are both no-ops in this implementation. `ChunkListener.afterChunkError(ChunkContext)`.

Author:
  Ali Shahbour

- ## Field Summary

  ### Fields inherited from interface org.springframework.batch.core.ChunkListener

  `ROLLBACK_EXCEPTION_KEY`

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

  `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterChunk(org.springframework.batch.core.scope.context.ChunkContext context)`
  `void`
  `afterChunkError(org.springframework.batch.core.scope.context.ChunkContext context)`
  `void`
  `beforeChunk(org.springframework.batch.core.scope.context.ChunkContext context)`
  `int`
  `getOrder()`

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

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

- ## Constructor Details

  - ### EventEmittingChunkListener

    public EventEmittingChunkListener(MessagePublisher messagePublisher, TaskEventProperties properties)

  - ### EventEmittingChunkListener

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

- ## Method Details

  - ### beforeChunk

    public void beforeChunk(org.springframework.batch.core.scope.context.ChunkContext context)
    Specified by:
      `beforeChunk` in interface `org.springframework.batch.core.ChunkListener`

  - ### afterChunk

    public void afterChunk(org.springframework.batch.core.scope.context.ChunkContext context)
    Specified by:
      `afterChunk` in interface `org.springframework.batch.core.ChunkListener`

  - ### afterChunkError

    public void afterChunkError(org.springframework.batch.core.scope.context.ChunkContext context)
    Specified by:
      `afterChunkError` in interface `org.springframework.batch.core.ChunkListener`

  - ### getOrder

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