On Jun 15, 2015, at 7:26 PM, Romain Manni-Bucau <rmannibu...@gmail.com> wrote:

>> 
>> 
>>> The trick is we need to rely on shutdown() being called when the bean is
>>> undeployed to ensure the application can successfully terminate and not
>>> leak timers.
>>> 
>> 
> 
> we can use ScheduledTask#cancel then
> 
> will change it and add a flag to go back to previous behavior if desired

No need for a flag if it works.

The cancel as opposed to shutdown has no wait time yet can return false 
signifying the timer will continue to fire.

We'd have to test it to ensure it works, but in the event cancel returns false 
we might want to call get(long, TimeUnit) on the future to see if we can wait 
for completion and try the cancel again.

Would take some playing around to ensure this actually would work.


-David

Reply via email to