Le 16 juin 2015 02:04, "David Blevins" <david.blev...@gmail.com> a écrit :
>
> 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.
>

No, would block shutdown. We already wait for completion not interrupting
the task.

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

Reply via email to