Package org.springframework.batch.core.listener

# Class CompositeChunkListener

java.lang.Object
org.springframework.batch.core.listener.CompositeChunkListener

All Implemented Interfaces:
  `ChunkListener`, `StepListener`

public class CompositeChunkListener extends Object implements ChunkListener

Author:
  Lucas Ward

- ## Field Summary

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

  `ROLLBACK_EXCEPTION_KEY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompositeChunkListener()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `afterChunk(ChunkContext context)`
  Call the registered listeners in reverse order.
  `void`
  `afterChunkError(ChunkContext context)`
  Call the registered listeners in reverse order.
  `void`
  `beforeChunk(ChunkContext context)`
  Call the registered listeners in order, respecting and prioritizing those that implement `Ordered`.
  `void`
  `register(ChunkListener chunkListener)`
  Register additional listener.
  `void`
  `setListeners(List<? extends ChunkListener> listeners)`
  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

  - ### CompositeChunkListener

    public CompositeChunkListener()

- ## Method Details

  - ### setListeners

    public void setListeners(List<? extends ChunkListener> listeners)
    Public setter for the listeners.
    Parameters:
      `listeners` - list of `ChunkListener`.

  - ### register

    public void register(ChunkListener chunkListener)
    Register additional listener.
    Parameters:
      `chunkListener` - instance of `ChunkListener`.

  - ### afterChunk

    public void afterChunk(ChunkContext context)
    Call the registered listeners in reverse order.
    Specified by:
      `afterChunk` in interface `ChunkListener`
    Parameters:
      `context` - The current `ChunkContext`
    See Also:
      - `ChunkListener.afterChunk(ChunkContext context)`

  - ### beforeChunk

    public void beforeChunk(ChunkContext context)
    Call the registered listeners in order, respecting and prioritizing those that implement `Ordered`.
    Specified by:
      `beforeChunk` in interface `ChunkListener`
    Parameters:
      `context` - The current `ChunkContext`
    See Also:
      - `ChunkListener.beforeChunk(ChunkContext context)`

  - ### afterChunkError

    public void afterChunkError(ChunkContext context)
    Call the registered listeners in reverse order.
    Specified by:
      `afterChunkError` in interface `ChunkListener`
    Parameters:
      `context` - the chunk context containing the exception that caused the underlying rollback.
    See Also:
      - `ChunkListener.afterChunkError(ChunkContext context)`