Interface StepExecutionListener

All Superinterfaces:
StepListener
All Known Implementing Classes:
ChunkMessageChannelItemWriter, CompositeStepExecutionListener, ExecutionContextPromotionListener, JobParameterExecutionContextCopyListener, MulticasterBatchListener, NoWorkFoundStepExecutionListener, StepExecutionListenerSupport, StepExecutionSimpleCompletionPolicy, StepListenerSupport, SystemCommandTasklet

public interface StepExecutionListener extends StepListener
Listener interface for the lifecycle of a Step.
Author:
Lucas Ward, Dave Syer, Mahmoud Ben Hassine, Parikshit Dutta
  • Method Summary

    Modifier and Type
    Method
    Description
    default ExitStatus
    afterStep(StepExecution stepExecution)
    Give a listener a chance to modify the exit status from a step.
    default void
    beforeStep(StepExecution stepExecution)
    Initialize the state of the listener with the StepExecution from the current scope.
  • Method Details

    • beforeStep

      default void beforeStep(StepExecution stepExecution)
      Initialize the state of the listener with the StepExecution from the current scope.
      Parameters:
      stepExecution - instance of StepExecution.
    • afterStep

      @Nullable default ExitStatus afterStep(StepExecution stepExecution)
      Give a listener a chance to modify the exit status from a step. The value returned is combined with the normal exit status by using ExitStatus.and(ExitStatus).

      Called after execution of the step's processing logic (whether successful or failed). Throwing an exception in this method has no effect, as it is only logged.

      Parameters:
      stepExecution - a StepExecution instance.
      Returns:
      an ExitStatus to combine with the normal value. Return null (the default) to leave the old value unchanged.