Class SplitState
- java.lang.Object
- org.springframework.batch.core.job.flow.support.state.AbstractState
- org.springframework.batch.core.job.flow.support.state.SplitState
- All Implemented Interfaces:
FlowHolder
,State
- Direct Known Subclasses:
JsrSplitState
public class SplitState extends AbstractState implements FlowHolder
- Since:
- 2.0
- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description SplitState(java.util.Collection<Flow> flows, java.lang.String name)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FlowExecutionStatus
doAggregation(java.util.Collection<FlowExecution> results, FlowExecutor executor)
java.util.Collection<Flow>
getFlows()
FlowExecutionStatus
handle(FlowExecutor executor)
Execute the flows in parallel by passing them to theTaskExecutor
and wait for all of them to finish before proceeding.boolean
isEndState()
Inquire as to whether aState
is an end state.void
setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Public setter for the taskExecutor.Methods inherited from class org.springframework.batch.core.job.flow.support.state.AbstractState
getName, toString
Method Detail
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
Public setter for the taskExecutor.- Parameters:
taskExecutor
- the taskExecutor to set
getFlows
public java.util.Collection<Flow> getFlows()
- Specified by:
getFlows
in interfaceFlowHolder
- Returns:
- the flows
handle
public FlowExecutionStatus handle(FlowExecutor executor) throws java.lang.Exception
Execute the flows in parallel by passing them to theTaskExecutor
and wait for all of them to finish before proceeding.- 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- See Also:
State.handle(FlowExecutor)
doAggregation
protected FlowExecutionStatus doAggregation(java.util.Collection<FlowExecution> results, FlowExecutor executor)
isEndState
public boolean isEndState()
Description copied from interface:State
Inquire as to whether aState
is an end state. Implementations should return false if processing can continue, even if that would require a restart.- Specified by:
isEndState
in interfaceState
- Returns:
- true if this
State
is the end of processing