You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by cocorossello <co...@gmail.com> on 2016/05/18 07:45:11 UTC

How to know if any @Scheduled operation is running

Hi, 

I'm trying to implement an "autostop" bash (or equivalent) script for tomcat
(I want to implement an "autoscaled" cluster, although I'm a newbie on
this). 

The script would check for active sessions and stop the server (and the VM)
whenever is 0, but we also need to look for active @Scheduled operations and
I was wondering if there is an easy way to look for this. The other option
is to implement a custom interceptor, but I was wondering if there is
already a solution for this.

Thanks in advance



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/How-to-know-if-any-Scheduled-operation-is-running-tp4678483.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: How to know if any @Scheduled operation is running

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

just throwing out an idea: did you check if it was available in quartz JMX
MBeans?

Issue is you will likely get the scheduled tasks but maybe not the "in
progress" information. An interceptor sounds good and you can expose it the
way you want (like having a file you can check in your script which is
easier than having an endpoint if you run in a secured environment where
curl/wget/... are not present).



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-05-18 9:45 GMT+02:00 cocorossello <co...@gmail.com>:

> Hi,
>
> I'm trying to implement an "autostop" bash (or equivalent) script for
> tomcat
> (I want to implement an "autoscaled" cluster, although I'm a newbie on
> this).
>
> The script would check for active sessions and stop the server (and the VM)
> whenever is 0, but we also need to look for active @Scheduled operations
> and
> I was wondering if there is an easy way to look for this. The other option
> is to implement a custom interceptor, but I was wondering if there is
> already a solution for this.
>
> Thanks in advance
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/How-to-know-if-any-Scheduled-operation-is-running-tp4678483.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>