类 SimpleFlow
- java.lang.Object
- org.springframework.batch.core.job.flow.support.SimpleFlow
- 所有已实现的接口:
Flow
,org.springframework.beans.factory.InitializingBean
- 直接已知子类:
JsrFlow
public class SimpleFlow extends java.lang.Object implements Flow, org.springframework.beans.factory.InitializingBean
AFlow
that branches conditionally depending on the exit status of the lastState
. The input parameters are the state transitions (in no particular order). The start state name can be specified explicitly (and must exist in the set of transitions), or computed from the existing transitions, if unambiguous.- 从以下版本开始:
- 2.0
- 作者:
- Dave Syer, Michael Minella
构造器概要
构造器 构造器 说明 SimpleFlow(java.lang.String name)
Create a flow with the given name.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Locate start state and pre-populate data structures needed for execution.java.lang.String
getName()
Get the name for this flow.State
getStartState()
State
getState(java.lang.String stateName)
Retrieve the State with the given name.protected java.util.Map<java.lang.String,State>
getStateMap()
java.util.Collection<State>
getStates()
Convenient accessor for clients needing to explore the states of this flow.protected java.util.Map<java.lang.String,java.util.Set<StateTransition>>
getTransitionMap()
protected boolean
isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution)
protected State
nextState(java.lang.String stateName, FlowExecutionStatus status, StepExecution stepExecution)
FlowExecution
resume(java.lang.String stateName, FlowExecutor executor)
void
setStateTransitionComparator(java.util.Comparator<StateTransition> stateTransitionComparator)
void
setStateTransitions(java.util.List<StateTransition> stateTransitions)
Public setter for the stateTransitions.FlowExecution
start(FlowExecutor executor)
构造器详细资料
SimpleFlow
public SimpleFlow(java.lang.String name)
Create a flow with the given name.- 参数:
name
- the name of the flow
方法详细资料
setStateTransitionComparator
public void setStateTransitionComparator(java.util.Comparator<StateTransition> stateTransitionComparator)
getStartState
public State getStartState()
getName
public java.lang.String getName()
Get the name for this flow.- 指定者:
getName
在接口中Flow
- 返回:
- the name of the flow
- 另请参阅:
Flow.getName()
setStateTransitions
public void setStateTransitions(java.util.List<StateTransition> stateTransitions)
Public setter for the stateTransitions.- 参数:
stateTransitions
- the stateTransitions to set
getState
public State getState(java.lang.String stateName)
Retrieve the State with the given name. If there is no State with the given name, then return null.
getStates
public java.util.Collection<State> getStates()
Convenient accessor for clients needing to explore the states of this flow.
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
Locate start state and pre-populate data structures needed for execution.- 指定者:
afterPropertiesSet
在接口中org.springframework.beans.factory.InitializingBean
- 抛出:
java.lang.Exception
- 另请参阅:
InitializingBean.afterPropertiesSet()
start
public FlowExecution start(FlowExecutor executor) throws FlowExecutionException
- 指定者:
start
在接口中Flow
- 参数:
executor
- theFlowExecutor
instance to use for the flow execution.- 返回:
- a
FlowExecution
containing the exit status of the flow. - 抛出:
FlowExecutionException
- thrown if error occurs during flow execution.- 另请参阅:
Flow.start(FlowExecutor)
resume
public FlowExecution resume(java.lang.String stateName, FlowExecutor executor) throws FlowExecutionException
- 指定者:
resume
在接口中Flow
- 参数:
stateName
- the name of the state to resume on.executor
- the context to be passed into each state executed.- 返回:
- a
FlowExecution
containing the exit status of the flow. - 抛出:
FlowExecutionException
- thrown if error occurs during flow execution.- 另请参阅:
Flow.resume(String, FlowExecutor)
getTransitionMap
protected java.util.Map<java.lang.String,java.util.Set<StateTransition>> getTransitionMap()
getStateMap
protected java.util.Map<java.lang.String,State> getStateMap()
nextState
protected State nextState(java.lang.String stateName, FlowExecutionStatus status, StepExecution stepExecution) throws FlowExecutionException
- 参数:
stateName
- the name of the next state.status
-FlowExecutionStatus
instance.stepExecution
-StepExecution
instance.- 返回:
- the next
Step
(or null if this is the end) - 抛出:
FlowExecutionException
- thrown if error occurs during nextState processing.
isFlowContinued
protected boolean isFlowContinued(State state, FlowExecutionStatus status, StepExecution stepExecution)