Jun 9th, 2011, 05:42 AM
Remove a task from a scheduler
I have a ThreadPoolTaskScheduler which schedules a lot of tasks. At random time, I have to remove one of this task without destroying the whole scheduler. How do I do that? I can't find a way to call something like remove(myRunnable). Maybe I use a schedule in a way it isn't designed for.
Jun 20th, 2011, 09:16 AM
Is there any spring scheduler implementation that supports my use case? Maybe any alternatives?
Jun 22nd, 2011, 01:49 AM
For all of those who are interested in a working solution: If you use any of the schedule() methods, you can use the returned ScheduledFuture to manage the lifecycle of a task. It would be useful if there may be a section in the documentation  which explains this topic such as:
"The lifecycle of the scheduled tasks can be managed over the returned ScheduledFuture. F.ex. for cancelling and termination".
Tags for this Thread