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
State
implementation for ending a job if it is in progress and continuing if
just starting.- Since:
- 2.0
- Author:
- Dave Syer
-
Constructor Summary
ConstructorDescriptionEndState
(FlowExecutionStatus status, String name) EndState
(FlowExecutionStatus status, String code, String name) EndState
(FlowExecutionStatus status, String code, String name, boolean abandon) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getCode()
protected FlowExecutionStatus
handle
(FlowExecutor executor) Return theFlowExecutionStatus
stored.protected boolean
boolean
Inquire as to whether aState
is an end state.protected void
setExitStatus
(FlowExecutor executor, String code) Performs any logic to update the exit status for the current flow.toString()
Methods inherited from class org.springframework.batch.core.job.flow.support.state.AbstractState
getName
-
Constructor Details
-
EndState
- Parameters:
status
- TheFlowExecutionStatus
to end withname
- The name of the state
-
EndState
- Parameters:
status
- TheFlowExecutionStatus
to end withname
- The name of the statecode
- The exit status to save
-
EndState
- 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 Details
-
getStatus
-
isAbandon
protected boolean isAbandon() -
getCode
-
handle
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:
Exception
- if anything goes wrong- See Also:
-
setExitStatus
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
- Overrides:
toString
in classAbstractState
-