接口 State
- 所有已知实现类:
AbstractState
,DecisionState
,EndState
,FlowState
,JsrEndState
,JsrSplitState
,JsrStepState
,SimpleFlowFactoryBean.DelegateState
,SplitState
,StepState
public interface State
- 从以下版本开始:
- 2.0
- 作者:
- Dave Syer
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 java.lang.String
getName()
The name of the state.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.
方法详细资料
getName
java.lang.String getName()
The name of the state. Should be unique within a flow.- 返回:
- the name of this state
handle
FlowExecutionStatus handle(FlowExecutor executor) throws java.lang.Exception
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.- 参数:
executor
- the context passed in by the caller- 返回:
- a status for the execution
- 抛出:
java.lang.Exception
- if anything goes wrong
isEndState
boolean isEndState()
Inquire as to whether aState
is an end state. Implementations should return false if processing can continue, even if that would require a restart.- 返回:
- true if this
State
is the end of processing