Sep 5th, 2011, 05:21 AM
How to check that step execution is interrupted?
Dear Batch developers,
I have an item processor, which internally makes a lot of computations (up to one hour) to calculate one item. However when the Job is marked a "STOPPING" I would like to process this condition ASAP. I have found out that this condition can be checked after the StepExecution is updated (see SimpleJobRepository#update(StepExecution)), but updating the StepExecution from item processor is a bit odd (I think).
Is it possible to extend the JobRepository API, so that the item processor can check that execution is interrupted (and return null or throw exception)?
Tags for this Thread