Class GeneratingTradeResettingListener
- java.lang.Object
- org.springframework.batch.core.listener.StepExecutionListenerSupport
- org.springframework.batch.sample.loop.GeneratingTradeResettingListener
- All Implemented Interfaces:
StepExecutionListener
,StepListener
,org.springframework.beans.factory.InitializingBean
public class GeneratingTradeResettingListener extends StepExecutionListenerSupport implements org.springframework.beans.factory.InitializingBean
This listener resets the count of its GeneratingTradeItemReader after the step.- Since:
- 2.0
- Author:
- Dan Garrette
Constructor Summary
Constructors Constructor Description GeneratingTradeResettingListener()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
ExitStatus
afterStep(StepExecution stepExecution)
Give a listener a chance to modify the exit status from a step.void
setReader(GeneratingTradeItemReader reader)
Methods inherited from class org.springframework.batch.core.listener.StepExecutionListenerSupport
beforeStep
Method Detail
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
- Overrides:
afterStep
in classStepExecutionListenerSupport
- Parameters:
stepExecution
-StepExecution
instance.- Returns:
- an
ExitStatus
to combine with the normal value. Returnnull
to leave the old value unchanged.
setReader
public void setReader(GeneratingTradeItemReader reader)
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception