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 java.lang.Object
      implements ChunkListener

  Author:
    Lucas Ward

- - ### Field Summary

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

      `ROLLBACK_EXCEPTION_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeChunkListener()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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(java.util.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 Detail

    - #### CompositeChunkListener

          public CompositeChunkListener()

  - ### Method Detail

    - #### setListeners

          public void setListeners(java.util.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)`