You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Yann BLAZART <ya...@externe.bnpparibas.com> on 2016/06/02 08:08:04 UTC

ManagedSecheduledExecutor

Hello,

It seems there is a little problem on TomEE 7.0.0 with ManagedScheduledExecutor.

In the Task, I have a Thread.sleep (intentional), this because I use scheduledAtFixRate
, then it's to make some pauses. Well.

When I canl ScheduledFutur.cancel(false), it sould not repeat the task, but not interrupt it.

But the sleep is interrupted with of course an InterruptedException, wich should be normal with ScheduledFutur.cancel(true)

Regards.


This message and any attachments (the "message") is
intended solely for the intended addressees and is confidential. 
If you receive this message in error,or are not the intended recipient(s), 
please delete it and any copies from your systems and immediately notify
the sender. Any unauthorized view, use that does not comply with its purpose, 
dissemination or disclosure, either whole or partial, is prohibited. Since the internet 
cannot guarantee the integrity of this message which may not be reliable, BNP PARIBAS 
(and its subsidiaries) shall not be liable for the message if modified, changed or falsified. 
Do not print this message unless it is necessary,consider the environment.

----------------------------------------------------------------------------------------------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le "message") 
sont etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
immediatement l'expediteur. Toute lecture non autorisee, toute utilisation de 
ce message qui n'est pas conforme a sa destination, toute diffusion ou toute 
publication, totale ou partielle, est interdite. L'Internet ne permettant pas d'assurer
l'integrite de ce message electronique susceptible d'alteration, BNP Paribas 
(et ses filiales) decline(nt) toute responsabilite au titre de ce message dans l'hypothese
ou il aurait ete modifie, deforme ou falsifie. 
N'imprimez ce message que si necessaire, pensez a l'environnement.

Re: ManagedSecheduledExecutor

Posted by Romain Manni-Bucau <rm...@gmail.com>.
ATM this behavior is fully delegated
to java.util.concurrent.ScheduledThreadPoolExecutor.ScheduledFutureTask#cancel
which does a terminated if cancelled.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-06-02 10:08 GMT+02:00 Yann BLAZART <yann.blazart@externe.bnpparibas.com
>:

> Hello,
>
> It seems there is a little problem on TomEE 7.0.0 with
> ManagedScheduledExecutor.
>
> In the Task, I have a Thread.sleep (intentional), this because I use
> scheduledAtFixRate
> , then it's to make some pauses. Well.
>
> When I canl ScheduledFutur.cancel(false), it sould not repeat the task,
> but not interrupt it.
>
> But the sleep is interrupted with of course an InterruptedException, wich
> should be normal with ScheduledFutur.cancel(true)
>
> Regards.
>
>
> This message and any attachments (the "message") is
> intended solely for the intended addressees and is confidential.
> If you receive this message in error,or are not the intended recipient(s),
> please delete it and any copies from your systems and immediately notify
> the sender. Any unauthorized view, use that does not comply with its
> purpose,
> dissemination or disclosure, either whole or partial, is prohibited. Since
> the internet
> cannot guarantee the integrity of this message which may not be reliable,
> BNP PARIBAS
> (and its subsidiaries) shall not be liable for the message if modified,
> changed or falsified.
> Do not print this message unless it is necessary,consider the environment.
>
>
> ----------------------------------------------------------------------------------------------------------------------------------
>
> Ce message et toutes les pieces jointes (ci-apres le "message")
> sont etablis a l'intention exclusive de ses destinataires et sont
> confidentiels.
> Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
> merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
> immediatement l'expediteur. Toute lecture non autorisee, toute utilisation
> de
> ce message qui n'est pas conforme a sa destination, toute diffusion ou
> toute
> publication, totale ou partielle, est interdite. L'Internet ne permettant
> pas d'assurer
> l'integrite de ce message electronique susceptible d'alteration, BNP
> Paribas
> (et ses filiales) decline(nt) toute responsabilite au titre de ce message
> dans l'hypothese
> ou il aurait ete modifie, deforme ou falsifie.
> N'imprimez ce message que si necessaire, pensez a l'environnement.
>