Class StepListenerAdapter
- java.lang.Object
- org.springframework.batch.core.jsr.StepListenerAdapter
- All Implemented Interfaces:
StepExecutionListener
,StepListener
public class StepListenerAdapter extends java.lang.Object implements StepExecutionListener
Wrapper class to adapt theStepListener
to aStepExecutionListener
.- Since:
- 3.0
- Author:
- Michael Minella
Constructor Summary
Constructors Constructor Description StepListenerAdapter(javax.batch.api.listener.StepListener delegate)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 theStepExecution
from the current scope.
Method Detail
beforeStep
public void beforeStep(StepExecution stepExecution)
Description copied from interface:StepExecutionListener
Initialize the state of the listener with theStepExecution
from the current scope.- Specified by:
beforeStep
in interfaceStepExecutionListener
- Parameters:
stepExecution
- instance ofStepExecution
.
afterStep
public ExitStatus afterStep(StepExecution stepExecution)
Description copied from interface:StepExecutionListener
Give a listener a chance to modify the exit status from a step. The value returned will be combined with the normal exit status usingExitStatus.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.- Specified by:
afterStep
in interfaceStepExecutionListener
- Parameters:
stepExecution
-StepExecution
instance.- Returns:
- an
ExitStatus
to combine with the normal value. Returnnull
to leave the old value unchanged.