RESOLVED - BATCH-661: broken job interruption logic

SimpleJob now checks for interrupt before starting a step
This commit is contained in:
robokaso
2008-06-12 08:21:07 +00:00
parent 1d649da1aa
commit 722c5c1f0d
2 changed files with 44 additions and 14 deletions

View File

@@ -53,7 +53,7 @@ public class SimpleJob extends AbstractJob {
public void execute(JobExecution execution) throws JobExecutionException {
JobInstance jobInstance = execution.getJobInstance();
StepExecution currentStepExecution = null;
int startedCount = 0;
List steps = getSteps();
@@ -73,6 +73,10 @@ public class SimpleJob extends AbstractJob {
for (Iterator i = steps.iterator(); i.hasNext();) {
if (execution.getStatus() == BatchStatus.STOPPING) {
throw new JobInterruptedException("JobExecution interrupted.");
}
Step step = (Step) i.next();
if (shouldStart(jobInstance, step)) {