You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tonywestonuk <to...@totspics.com> on 2016/09/19 14:13:23 UTC

How to stop a ManagedScheduledExecutorService

Hi,

In @PostConstruct, I have a:

@Resource
ManagedScheduledExecutorService executorService;
..
executorService.scheduleWithFixedDelay(packetSender, 10, 10,
TimeUnit.SECONDS);

If the app is undeployed, I want to cancel this schedule.  How do I do this?

Thanks.





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/How-to-stop-a-ManagedScheduledExecutorService-tp4680152.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: How to stop a ManagedScheduledExecutorService

Posted by tonywestonuk <to...@totspics.com>.
:-D  Thanks!!..... Again!



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/How-to-stop-a-ManagedScheduledExecutorService-tp4680152p4680156.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: How to stop a ManagedScheduledExecutorService

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Keep the returned instance and call cancel

Le 19 sept. 2016 16:17, "tonywestonuk" <to...@totspics.com> a écrit :

> Hi,
>
> In @PostConstruct, I have a:
>
> @Resource
> ManagedScheduledExecutorService executorService;
> ..
> executorService.scheduleWithFixedDelay(packetSender, 10, 10,
> TimeUnit.SECONDS);
>
> If the app is undeployed, I want to cancel this schedule.  How do I do
> this?
>
> Thanks.
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/How-to-stop-a-ManagedScheduledExecutorService-tp4680152.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>