JobRestartException, StartLimitExceededException {
if (execution.isStopping()) {
throw new JobInterruptedException("JobExecution interrupted.");
}
JobInstance jobInstance = execution.getJobInstance();
StepExecution lastStepExecution = jobRepository.getLastStepExecution(jobInstance, step.getName());
if (stepExecutionPartOfExistingJobExecution(execution, lastStepExecution)) {
// If the last execution of this step was in the same job, it's
// probably intentional so we want to run it again...
logger.info(String.format("Duplicate step [%s] detected in execution of job=[%s]. "
+ "If either step fails, both will be executed again on restart.", step.getName(), jobInstance
.getJobName()));
lastStepExecution = null;
}
StepExecution currentStepExecution = lastStepExecution;