I have a scheduled task that can run a service for 1 - 2 hours. Is there a way to manually stop (or kill) a service that is executing?
There is no generic mechanism to stop executing tasks. I would recommend adding a flag that is checked periodically by the task, and a JMX interface to control this flag’s state. Don’t forget to make this flag volatile.
Thanks for the reply, I just wanted to make sure I wasn’t overlooking something before I wrote some code to do this.