Class LimitDecider
- java.lang.Object
- org.springframework.batch.sample.loop.LimitDecider
- All Implemented Interfaces:
JobExecutionDecider
public class LimitDecider extends java.lang.Object implements JobExecutionDecider
This decider will return "CONTINUE" until the limit it reached, at which point it will return "COMPLETE".- Since:
- 2.0
- Author:
- Dan Garrette
Constructor Summary
Constructors Constructor Description LimitDecider()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlowExecutionStatus
decide(JobExecution jobExecution, StepExecution stepExecution)
Strategy for branching an execution based on the state of an ongoingJobExecution
.void
setLimit(int limit)
Method Detail
decide
public FlowExecutionStatus decide(JobExecution jobExecution, StepExecution stepExecution)
Description copied from interface:JobExecutionDecider
Strategy for branching an execution based on the state of an ongoingJobExecution
. The return value will be used as a status to determine the next step in the job.- Specified by:
decide
in interfaceJobExecutionDecider
- Parameters:
jobExecution
- a job executionstepExecution
- the latest step execution (may benull
)- Returns:
- the exit status code
setLimit
public void setLimit(int limit)
- Parameters:
limit
- number of times to return "CONTINUE"