public class JobFlowExecutor extends java.lang.Object implements FlowExecutor
FlowExecutor for use in components that need to
execute a flow related to a JobExecution.| Modifier and Type | Field and Description |
|---|---|
protected ExitStatus |
exitStatus |
| Constructor and Description |
|---|
JobFlowExecutor(JobRepository jobRepository,
StepHandler stepHandler,
JobExecution execution) |
| Modifier and Type | Method and Description |
|---|---|
void |
abandonStepExecution()
Handle any status changes that might be needed at the start of a state.
|
void |
addExitStatus(java.lang.String code) |
void |
close(FlowExecution result)
Chance to clean up resources at the end of a flow (whether it completed
successfully or not).
|
java.lang.String |
executeStep(Step step) |
protected BatchStatus |
findBatchStatus(FlowExecutionStatus status) |
JobExecution |
getJobExecution() |
StepExecution |
getStepExecution() |
boolean |
isRestart() |
void |
updateJobExecutionStatus(FlowExecutionStatus status)
Handle any status changes that might be needed in the
JobExecution. |
protected ExitStatus exitStatus
public JobFlowExecutor(JobRepository jobRepository, StepHandler stepHandler, JobExecution execution)
jobRepository - instance of JobRepository.stepHandler - instance of StepHandler.execution - instance of JobExecution.public java.lang.String executeStep(Step step) throws JobInterruptedException, JobRestartException, StartLimitExceededException
executeStep in interface FlowExecutorstep - a Step to executeFlowJobInterruptedException - thrown if job was interrupted.JobRestartException - thrown if job restart is not allowed.StartLimitExceededException - thrown if start limit is exceeded.public void abandonStepExecution()
FlowExecutorabandonStepExecution in interface FlowExecutorpublic void updateJobExecutionStatus(FlowExecutionStatus status)
FlowExecutorJobExecution.updateJobExecutionStatus in interface FlowExecutorstatus - status to update the JobExecution to.public JobExecution getJobExecution()
getJobExecution in interface FlowExecutorJobExecution@Nullable public StepExecution getStepExecution()
getStepExecution in interface FlowExecutorStepExecution or null if there is nonepublic void close(FlowExecution result)
FlowExecutorclose in interface FlowExecutorresult - the final FlowExecutionpublic boolean isRestart()
isRestart in interface FlowExecutorpublic void addExitStatus(java.lang.String code)
addExitStatus in interface FlowExecutorcode - the label for the exit status when a flow or sub-flow endsprotected BatchStatus findBatchStatus(FlowExecutionStatus status)
status - FlowExecutionStatus to convert.BatchStatus appropriate for the FlowExecutionStatus provided