For point 2, the use case is:
- We want to stop a job (or some reading items) when the job is running over a time (e.g. exceed 2 hours). The strategy we thought is to save the start time at context in beforeStep event. Then, the item reader will check if now-start time > overrun limit. If so, it will write some alert logging and throw JobOverrunException (or return null).
- in fact, the variable can be other environment conditions besides start-time, e.g. current queue length, current no. of files in a directory, etc.