org.springframework.batch.core.job.flow
Interface State

All Known Implementing Classes:
AbstractState, DecisionState, EndState, FlowState, SplitState, StepState

public interface State

Since:
2.0
Author:
Dave Syer

Method Summary
 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 next State.
 boolean isEndState()
          Inquire as to whether a State is an end state.
 

Method Detail

getName

String getName()
The name of the state. Should be unique within a flow.

Returns:
the name of this state

handle

FlowExecutionStatus handle(FlowExecutor executor)
                           throws Exception
Handle some business or processing logic and return a status that can be used to drive a flow to the next State. The status can be any string, but special meaning is assigned to the static constants in FlowExecution. The context can be used by implementations to do whatever they need to do. The same context will be passed to all State instances, so implementations should be careful that the context is thread safe, or used in a thread safe manner.

Parameters:
executor - the context passed in by the caller
Returns:
a status for the execution
Throws:
Exception - if anything goes wrong

isEndState

boolean isEndState()
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 © 2013 SpringSource. All Rights Reserved.