RESOLVED - issue BATCH-529: StepExecutionListener.afterStep() should only be called on success

RESOLVED - issue BATCH-532: StepExecutionListener can influence exit status but not status of step execution

listener.afterStep() call moved from catch block to the end of the try block
This commit is contained in:
robokaso
2008-04-01 11:07:53 +00:00
parent 25281b236e
commit 7746cfc304
2 changed files with 34 additions and 13 deletions

View File

@@ -350,6 +350,8 @@ public class ItemOrientedStep extends AbstractStep {
}
});
status = status.and(listener.afterStep(stepExecution));
fatalException.setException(updateStatus(stepExecution, BatchStatus.COMPLETED));
}
@@ -371,13 +373,6 @@ public class ItemOrientedStep extends AbstractStep {
}
finally {
try {
status = status.and(listener.afterStep(stepExecution));
}
catch (RuntimeException e) {
logger.error("Unexpected error in listener after step.", e);
}
stepExecution.setExitStatus(status);
stepExecution.setEndTime(new Date(System.currentTimeMillis()));