org.springframework.batch.core.listener

## Class CompositeStepExecutionListener

- java.lang.Object
- - org.springframework.batch.core.listener.CompositeStepExecutionListener

- All Implemented Interfaces:
    StepExecutionListener, StepListener

      public class CompositeStepExecutionListener
      extends java.lang.Object
      implements StepExecutionListener

  Author:
    Lucas Ward, Dave Syer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompositeStepExecutionListener()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ExitStatus` | `afterStep(StepExecution stepExecution)` Call the registered listeners in reverse order, respecting and prioritizing those that implement `Ordered`.
    `void` | `beforeStep(StepExecution stepExecution)` Call the registered listeners in order, respecting and prioritizing those that implement `Ordered`.
    `void` | `register(StepExecutionListener stepExecutionListener)` Register additional listener.
    `void` | `setListeners(StepExecutionListener[] 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

    - #### CompositeStepExecutionListener

          public CompositeStepExecutionListener()

  - ### Method Detail

    - #### setListeners

          public void setListeners(StepExecutionListener[] listeners)

      Public setter for the listeners.
      Parameters:
        `listeners` - list of `StepExecutionListener`s to be called when step execution events occur.

    - #### register

          public void register(StepExecutionListener stepExecutionListener)

      Register additional listener.
      Parameters:
        `stepExecutionListener` - instance of `StepExecutionListener` to be registered.

    - #### afterStep

          @Nullable
          public ExitStatus afterStep(StepExecution stepExecution)

      Call the registered listeners in reverse order, respecting and prioritizing those that implement `Ordered`.
      Specified by:
        `afterStep` in interface `StepExecutionListener`
      Parameters:
        `stepExecution` - `StepExecution` instance.
      Returns:
        an `ExitStatus` to combine with the normal value. Return `null` to leave the old value unchanged.
      See Also:
        `StepExecutionListener.afterStep(StepExecution)`

    - #### beforeStep

          public void beforeStep(StepExecution stepExecution)

      Call the registered listeners in order, respecting and prioritizing those that implement `Ordered`.
      Specified by:
        `beforeStep` in interface `StepExecutionListener`
      Parameters:
        `stepExecution` - instance of `StepExecution`.
      See Also:
        `StepExecutionListener.beforeStep(StepExecution)`