org.springframework.batch.core.job.flow.support.state
Class SplitState

java.lang.Object
  extended by org.springframework.batch.core.job.flow.support.state.AbstractState
      extended by org.springframework.batch.core.job.flow.support.state.SplitState
All Implemented Interfaces:
State

public class SplitState
extends AbstractState

A State implementation that splits a Flow into multiple parallel subflows.

Since:
2.0
Author:
Dave Syer

Constructor Summary
SplitState(Collection<Flow> flows, String name)
           
 
Method Summary
 FlowExecutionStatus handle(FlowExecutor executor)
          Execute the flows in parallel by passing them to the TaskExecutor and wait for all of them to finish before proceeding.
 boolean isEndState()
          Inquire as to whether a State is an end state.
 void setTaskExecutor(TaskExecutor taskExecutor)
          Public setter for the taskExecutor.
 
Methods inherited from class org.springframework.batch.core.job.flow.support.state.AbstractState
getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplitState

public SplitState(Collection<Flow> flows,
                  String name)
Parameters:
name -
Method Detail

setTaskExecutor

public void setTaskExecutor(TaskExecutor taskExecutor)
Public setter for the taskExecutor.

Parameters:
taskExecutor - the taskExecutor to set

handle

public FlowExecutionStatus handle(FlowExecutor executor)
                           throws Exception
Execute the flows in parallel by passing them to the TaskExecutor and wait for all of them to finish before proceeding.

Specified by:
handle in interface State
Specified by:
handle in class AbstractState
Parameters:
executor - the context passed in by the caller
Returns:
a status for the execution
Throws:
Exception - if anything goes wrong
See Also:
State.handle(FlowExecutor)

isEndState

public boolean isEndState()
Description copied from interface: State
Inquire as to whether a State is an end state. Implementations should return false if processing can continue, even if that would require a restart.

Returns:
true if this State is the end of processing


Copyright © 2009 SpringSource. All Rights Reserved.