Say my web app has two spring cron jobs scheduled to run every minute/hour. Before I'm redeploying my app I can't just shut it down, I must wait for jobs to be finished correctly. I can provide some flag in database or somewhere else, so that jobs will stop to run iteratively - every minute or hour - put some check inside job function to return/do nothing on the next trigger call if such flag checked.
But how can I wait for current job call to finish? And how to see it from ant or other outside script - to choose good time for server shutdown.
There may be solution to put some flag in db or file, and read it. But may be there is some more accurate way - jms or something like that?