jakartaee / batch

The Jakarta Batch project produces the Batch Specification and API.
https://projects.eclipse.org/projects/ee4j.batch
Apache License 2.0
13 stars 18 forks source link

Clarify timepoint and status of job when JobListener#afterJob() is called #76

Open follis opened 4 years ago

follis commented 4 years ago

Originally opened as bug 6975 by Turbokiwi

--------------Original Comment History---------------------------- Comment from = Turbokiwi on 2015-05-05 19:26:56 +0000

The spec is a bit unclear about the exact time, when JobListener#afterJob() is called. Point 9.2.1 of the spec says: "A job listener receives control before and after a job execution runs". The JavaDoc of the interface says "The afterJob method receives control after the job execution ends."

When no exception has been thrown during the job, which JobContext#getExitStatus()/JobContext#getBatchStatus() should an implementation deliver inside JobListener#afterJob(). Does an JobExecution#getEndTime() has to be availabe at this time or should the endTime be set after all JobListeners have returned normally?