You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tschuler <th...@opentext.com> on 2013/10/09 14:56:53 UTC

Startup order for web applications and scheduled beans

Hi!

We use latest TomEE 1.6.0 snapshot.

Our application includes scheduled beans and web applications.
To get a defined startup order we use an application.xml including
<initialize-in-order>true</initialize-in-order> tag.
It allows to define startup order of web applications but scheduled bean
startup is allways done before.

Is there a way to define a different startup order that allows to initialize
the scheduled beans after some of the web applications are initialized?

Best regards,
Thomas




--
View this message in context: http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Shutdown order for web applications

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

not yet but you can use tomee.sh or jmx or any deployer/undeploy you
want to do it manually.

BTW can't you support the undeployment order? Seems a bad practise to
couple so much binaries without merging them.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-02-11 10:12 GMT+01:00 tschuler <th...@opentext.com>:
> Hi Romain!
>
> For TomEE 1.6.0 release we observed that a predefined startup order for web
> applications (<initialize-in-order>true</initialize-in-order> in
> application.xml) works.
> But we get in trouble now while server shutdown: the web applications get
> down the same order as they were started, e.g.:
> Startup:
> WebApp1 is started
> WebApp2 is started
> WebApp3 is started
> Shutdown:
> WebApp1 is destroyed
> WebApp2 is destroyed
> WebApp3 is destroyed
>
> What we need or what we expect is a reverse shutdown order:
> WebApp3 is destroyed
> WebApp2 is destroyed
> WebApp1 is destroyed
>
> Is there a way to get a define shutdown order?
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4667645.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Shutdown order for web applications

Posted by tschuler <th...@opentext.com>.
Hi Romain!

For TomEE 1.6.0 release we observed that a predefined startup order for web
applications (<initialize-in-order>true</initialize-in-order> in
application.xml) works.
But we get in trouble now while server shutdown: the web applications get
down the same order as they were started, e.g.:
Startup:
WebApp1 is started
WebApp2 is started
WebApp3 is started
Shutdown:
WebApp1 is destroyed
WebApp2 is destroyed
WebApp3 is destroyed

What we need or what we expect is a reverse shutdown order:
WebApp3 is destroyed
WebApp2 is destroyed
WebApp1 is destroyed

Is there a way to get a define shutdown order?

Best regards,
Thomas



--
View this message in context: http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4667645.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: AW: Startup order for web applications and scheduled beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
No afaik
Le 12 oct. 2013 03:15, "tschuler" <th...@opentext.com> a écrit :

> Hi Romain!
>
> That might work.
> But is there a "standardized" way to let a scheduled bean / message driven
> bean not be started immediately but within a time delay?
>
> Best regards,
>                 Thomas
>
> Von: Romain Manni-Bucau [via OpenEJB] [mailto:
> ml-node+s979440n4665509h89@n4.nabble.com]
> Gesendet: Mittwoch, 9. Oktober 2013 17:59
> An: Thomas Schuler
> Betreff: Re: Startup order for web applications and scheduled beans
>
> Was basically thinking to an attribute in the ejb "boolean started" and a
> cdi @Observes Start which will trigger started = true. While !start do
> nothing...CDI is not mandatory, the webapp can set started to true manualy
> too.
>
> It can surely be done through an interceptor too. Depend how you want to
> handle it.
>
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/10/9 tschuler <[hidden
> email]</user/SendEmail.jtp?type=node&node=4665509&i=0>>
>
> > Hi Romain!
> >
> > Do you have an example for synchronizing a scheduled bean with a custom
> > event?
> >
> > Best regards,
> >                 Thomas
> >
> > Von: Romain Manni-Bucau [via OpenEJB] [mailto:
> > [hidden email]</user/SendEmail.jtp?type=node&node=4665509&i=1>]
> > Gesendet: Mittwoch, 9. Oktober 2013 16:45
> > An: Thomas Schuler
> > Betreff: Re: Startup order for web applications and scheduled beans
> >
> > Hi
> >
> > Not at the moment. It just follow the lifecycle of the EJB deployment.
> You
> > can still synchronize it with a custom event (CDI or not) "Start"
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> > http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
> >
> >
> > 2013/10/9 tschuler <[hidden
> > email]</user/SendEmail.jtp?type=node&node=4665498&i=0>>
> >
> > > Hi!
> > >
> > > We use latest TomEE 1.6.0 snapshot.
> > >
> > > Our application includes scheduled beans and web applications.
> > > To get a defined startup order we use an application.xml including
> > > <initialize-in-order>true</initialize-in-order> tag.
> > > It allows to define startup order of web applications but scheduled
> bean
> > > startup is allways done before.
> > >
> > > Is there a way to define a different startup order that allows to
> > > initialize
> > > the scheduled beans after some of the web applications are initialized?
> > >
> > > Best regards,
> > > Thomas
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496.html
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665498.html
> > To unsubscribe from Startup order for web applications and scheduled
> > beans, click here<
> > >.
> > NAML<
> >
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> > >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665503.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665509.html
> To unsubscribe from Startup order for web applications and scheduled
> beans, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665496&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjU0OTZ8LTE4NTIyNTQ0OTI=
> >.
> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665556.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

AW: Startup order for web applications and scheduled beans

Posted by tschuler <th...@opentext.com>.
Hi Romain!

That might work.
But is there a "standardized" way to let a scheduled bean / message driven bean not be started immediately but within a time delay?

Best regards,
                Thomas

Von: Romain Manni-Bucau [via OpenEJB] [mailto:ml-node+s979440n4665509h89@n4.nabble.com]
Gesendet: Mittwoch, 9. Oktober 2013 17:59
An: Thomas Schuler
Betreff: Re: Startup order for web applications and scheduled beans

Was basically thinking to an attribute in the ejb "boolean started" and a
cdi @Observes Start which will trigger started = true. While !start do
nothing...CDI is not mandatory, the webapp can set started to true manualy
too.

It can surely be done through an interceptor too. Depend how you want to
handle it.


*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/10/9 tschuler <[hidden email]</user/SendEmail.jtp?type=node&node=4665509&i=0>>

> Hi Romain!
>
> Do you have an example for synchronizing a scheduled bean with a custom
> event?
>
> Best regards,
>                 Thomas
>
> Von: Romain Manni-Bucau [via OpenEJB] [mailto:
> [hidden email]</user/SendEmail.jtp?type=node&node=4665509&i=1>]
> Gesendet: Mittwoch, 9. Oktober 2013 16:45
> An: Thomas Schuler
> Betreff: Re: Startup order for web applications and scheduled beans
>
> Hi
>
> Not at the moment. It just follow the lifecycle of the EJB deployment. You
> can still synchronize it with a custom event (CDI or not) "Start"
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/10/9 tschuler <[hidden
> email]</user/SendEmail.jtp?type=node&node=4665498&i=0>>
>
> > Hi!
> >
> > We use latest TomEE 1.6.0 snapshot.
> >
> > Our application includes scheduled beans and web applications.
> > To get a defined startup order we use an application.xml including
> > <initialize-in-order>true</initialize-in-order> tag.
> > It allows to define startup order of web applications but scheduled bean
> > startup is allways done before.
> >
> > Is there a way to define a different startup order that allows to
> > initialize
> > the scheduled beans after some of the web applications are initialized?
> >
> > Best regards,
> > Thomas
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665498.html
> To unsubscribe from Startup order for web applications and scheduled
> beans, click here<
> >.
> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665503.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665509.html
To unsubscribe from Startup order for web applications and scheduled beans, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665496&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjU0OTZ8LTE4NTIyNTQ0OTI=>.
NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665556.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Startup order for web applications and scheduled beans

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Was basically thinking to an attribute in the ejb "boolean started" and a
cdi @Observes Start which will trigger started = true. While !start do
nothing...CDI is not mandatory, the webapp can set started to true manualy
too.

It can surely be done through an interceptor too. Depend how you want to
handle it.


*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/10/9 tschuler <th...@opentext.com>

> Hi Romain!
>
> Do you have an example for synchronizing a scheduled bean with a custom
> event?
>
> Best regards,
>                 Thomas
>
> Von: Romain Manni-Bucau [via OpenEJB] [mailto:
> ml-node+s979440n4665498h48@n4.nabble.com]
> Gesendet: Mittwoch, 9. Oktober 2013 16:45
> An: Thomas Schuler
> Betreff: Re: Startup order for web applications and scheduled beans
>
> Hi
>
> Not at the moment. It just follow the lifecycle of the EJB deployment. You
> can still synchronize it with a custom event (CDI or not) "Start"
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/10/9 tschuler <[hidden
> email]</user/SendEmail.jtp?type=node&node=4665498&i=0>>
>
> > Hi!
> >
> > We use latest TomEE 1.6.0 snapshot.
> >
> > Our application includes scheduled beans and web applications.
> > To get a defined startup order we use an application.xml including
> > <initialize-in-order>true</initialize-in-order> tag.
> > It allows to define startup order of web applications but scheduled bean
> > startup is allways done before.
> >
> > Is there a way to define a different startup order that allows to
> > initialize
> > the scheduled beans after some of the web applications are initialized?
> >
> > Best regards,
> > Thomas
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665498.html
> To unsubscribe from Startup order for web applications and scheduled
> beans, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665496&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjU0OTZ8LTE4NTIyNTQ0OTI=
> >.
> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665503.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

AW: Startup order for web applications and scheduled beans

Posted by tschuler <th...@opentext.com>.
Hi Romain!

Do you have an example for synchronizing a scheduled bean with a custom event?

Best regards,
                Thomas

Von: Romain Manni-Bucau [via OpenEJB] [mailto:ml-node+s979440n4665498h48@n4.nabble.com]
Gesendet: Mittwoch, 9. Oktober 2013 16:45
An: Thomas Schuler
Betreff: Re: Startup order for web applications and scheduled beans

Hi

Not at the moment. It just follow the lifecycle of the EJB deployment. You
can still synchronize it with a custom event (CDI or not) "Start"

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/10/9 tschuler <[hidden email]</user/SendEmail.jtp?type=node&node=4665498&i=0>>

> Hi!
>
> We use latest TomEE 1.6.0 snapshot.
>
> Our application includes scheduled beans and web applications.
> To get a defined startup order we use an application.xml including
> <initialize-in-order>true</initialize-in-order> tag.
> It allows to define startup order of web applications but scheduled bean
> startup is allways done before.
>
> Is there a way to define a different startup order that allows to
> initialize
> the scheduled beans after some of the web applications are initialized?
>
> Best regards,
> Thomas
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665498.html
To unsubscribe from Startup order for web applications and scheduled beans, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665496&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjU0OTZ8LTE4NTIyNTQ0OTI=>.
NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496p4665503.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Startup order for web applications and scheduled beans

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

Not at the moment. It just follow the lifecycle of the EJB deployment. You
can still synchronize it with a custom event (CDI or not) "Start"

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/10/9 tschuler <th...@opentext.com>

> Hi!
>
> We use latest TomEE 1.6.0 snapshot.
>
> Our application includes scheduled beans and web applications.
> To get a defined startup order we use an application.xml including
> <initialize-in-order>true</initialize-in-order> tag.
> It allows to define startup order of web applications but scheduled bean
> startup is allways done before.
>
> Is there a way to define a different startup order that allows to
> initialize
> the scheduled beans after some of the web applications are initialized?
>
> Best regards,
> Thomas
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Startup-order-for-web-applications-and-scheduled-beans-tp4665496.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>