org.springframework.batch.core

## Interface StepExecutionListener

- All Superinterfaces:
    StepListener
  All Known Implementing Classes:
    ChunkMessageChannelItemWriter, CompositeCustomerUpdateLineTokenizer, CompositeStepExecutionListener, ExecutionContextPromotionListener, GeneratingTradeResettingListener, InfiniteLoopWriter, JobParameterExecutionContextCopyListener, MulticasterBatchListener, NoWorkFoundStepExecutionListener, StagingItemListener, StagingItemReader, StagingItemWriter, StepExecutionListenerSupport, StepExecutionSimpleCompletionPolicy, StepListenerAdapter, StepListenerSupport, SummaryFooterCallback, SystemCommandTasklet

      public interface StepExecutionListener
      extends StepListener

  Listener interface for the lifecycle of a `Step`.
  Author:
    Lucas Ward, Dave Syer

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ExitStatus` | `afterStep(StepExecution stepExecution)` Give a listener a chance to modify the exit status from a step.
    `void` | `beforeStep(StepExecution stepExecution)` Initialize the state of the listener with the `StepExecution` from the current scope.

- - ### Method Detail

    - #### beforeStep

          void beforeStep(StepExecution stepExecution)

      Initialize the state of the listener with the `StepExecution` from the current scope.
      Parameters:
        `stepExecution` -

    - #### afterStep

          ExitStatus afterStep(StepExecution stepExecution)

      Give a listener a chance to modify the exit status from a step. The value returned will be combined with the normal exit status using `ExitStatus.and(ExitStatus)`. Called after execution of step's processing logic (both successful or failed). Throwing exception in this method has no effect, it will only be logged.
      Returns:
        an `ExitStatus` to combine with the normal value. Return null to leave the old value unchanged.