Class DecisionState
- java.lang.Object
- org.springframework.batch.core.job.flow.support.state.AbstractState
- org.springframework.batch.core.job.flow.support.state.DecisionState
- All Implemented Interfaces:
State
public class DecisionState extends AbstractState
State that requires a decider to make the status decision.- Since:
- 2.0
- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description DecisionState(JobExecutionDecider decider, java.lang.String name)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlowExecutionStatus
handle(FlowExecutor executor)
Handle some business or processing logic and return a status that can be used to drive a flow to the nextState
.boolean
isEndState()
Inquire as to whether aState
is an end state.Methods inherited from class org.springframework.batch.core.job.flow.support.state.AbstractState
getName, toString
Constructor Detail
DecisionState
public DecisionState(JobExecutionDecider decider, java.lang.String name)
- Parameters:
decider
- theJobExecutionDecider
instance to make the status decision.name
- the name of the decision state.
Method Detail
handle
public FlowExecutionStatus handle(FlowExecutor executor) throws java.lang.Exception
Description copied from interface:State
Handle some business or processing logic and return a status that can be used to drive a flow to the nextState
. The status can be any string, but special meaning is assigned to the static constants inFlowExecution
. The context can be used by implementations to do whatever they need to do. The same context will be passed to allState
instances, so implementations should be careful that the context is thread-safe, or used in a thread-safe manner.- Specified by:
handle
in interfaceState
- Specified by:
handle
in classAbstractState
- Parameters:
executor
- the context passed in by the caller- Returns:
- a status for the execution
- Throws:
java.lang.Exception
- if anything goes wrong