Class EndState
- java.lang.Object
- org.springframework.batch.core.job.flow.support.state.AbstractState
- org.springframework.batch.core.job.flow.support.state.EndState
- All Implemented Interfaces:
State
- Direct Known Subclasses:
JsrEndState
public class EndState extends AbstractState
State
implementation for ending a job if it is in progress and continuing if just starting.- Since:
- 2.0
- Author:
- Dave Syer
Constructor Summary
Constructors Constructor Description EndState(FlowExecutionStatus status, java.lang.String name)
EndState(FlowExecutionStatus status, java.lang.String code, java.lang.String name)
EndState(FlowExecutionStatus status, java.lang.String code, java.lang.String name, boolean abandon)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getCode()
protected FlowExecutionStatus
getStatus()
FlowExecutionStatus
handle(FlowExecutor executor)
Return theFlowExecutionStatus
stored.protected boolean
isAbandon()
boolean
isEndState()
Inquire as to whether aState
is an end state.protected void
setExitStatus(FlowExecutor executor, java.lang.String code)
Performs any logic to update the exit status for the current flow.java.lang.String
toString()
Methods inherited from class org.springframework.batch.core.job.flow.support.state.AbstractState
getName
Constructor Detail
EndState
public EndState(FlowExecutionStatus status, java.lang.String name)
- Parameters:
status
- TheFlowExecutionStatus
to end withname
- The name of the state
EndState
public EndState(FlowExecutionStatus status, java.lang.String code, java.lang.String name)
- Parameters:
status
- TheFlowExecutionStatus
to end withname
- The name of the statecode
- The exit status to save
EndState
public EndState(FlowExecutionStatus status, java.lang.String code, java.lang.String name, boolean abandon)
- Parameters:
status
- TheFlowExecutionStatus
to end withname
- The name of the statecode
- The exit status to saveabandon
- flag to indicate that previous step execution can be marked as abandoned (if there is one)
Method Detail
getStatus
protected FlowExecutionStatus getStatus()
isAbandon
protected boolean isAbandon()
getCode
protected java.lang.String getCode()
handle
public FlowExecutionStatus handle(FlowExecutor executor) throws java.lang.Exception
Return theFlowExecutionStatus
stored.- 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)
setExitStatus
protected void setExitStatus(FlowExecutor executor, java.lang.String code)
Performs any logic to update the exit status for the current flow.- Parameters:
executor
-FlowExecutor
for the current flowcode
- The exit status to save
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.- Returns:
- true if this
State
is the end of processing
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractState