As the batch runtime, I need a way to stop a long running tasklet. The JSR provides the facility for the runtime to call a method on an executing Tasklet (Batchlet in the JSR world), and a well behaved Tasklet will stop processing and return.
- Add the Tasklet#stop() method to the Tasklet interface.
- Implement the new method accordingly in the places where we implement the Tasklet interface within the framework (ChunkOrientedTasklet for example).
- Update the JobOperator#stop() to call the Tasklet#stop() method if a tasklet is currently running.