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

removed the try/catch block around listener.afterStep()
updated javadoc for StepExecutionListener#afterStep(..)
This commit is contained in:
robokaso
2008-04-01 11:40:59 +00:00
parent 7746cfc304
commit bff748f576
3 changed files with 34 additions and 6 deletions

View File

@@ -48,6 +48,9 @@ public interface StepExecutionListener extends StepListener {
* returned will be combined with the normal exit status using
* {@link ExitStatus#and(ExitStatus)}.
*
* Called after successful execution of step's processing logic. Throwing
* exception in this method will cause step to fail.
*
* @return an {@link ExitStatus} to combine with the normal value. Return
* null to leave the old value unchanged.
*/

View File

@@ -137,12 +137,7 @@ public class TaskletStep extends AbstractStep implements Step, InitializingBean,
listener.beforeStep(stepExecution);
exitStatus = tasklet.execute();
try {
exitStatus = exitStatus.and(listener.afterStep(stepExecution));
}
catch (Exception e) {
logger.error("Encountered an error on listener close.", e);
}
exitStatus = exitStatus.and(listener.afterStep(stepExecution));
try {
jobRepository.saveOrUpdateExecutionContext(stepExecution);