You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2011/10/05 11:04:08 UTC

Development decision regarding tapestry IoC (Application start-up and shutdown)

I have a current project that I am VERY close to converting all it's code
from core servlets to t5.2.6. But I have this project split to a jar file
containing most of the business logic, servicec, dao, etc.

After intergrating this jar into the tapestry project, I need to start some
services and shut them down when I'm done.
For startup I use the *@Startup* annotation to mark a *static void* method
which runs a thread, initializing my services.

About shutdown I found very nice information on this page:
https://cwiki.apache.org/confluence/display/TAPESTRY/Tapestry+Inversion+of+Control+FAQ

But this implies carrying tapestry IoC jar along with my jar (because
services are annotated with tapestry IoC annotations) even in an environment
that doesn't use tapestry's IoC. I just don't wan't my jar to be tapestry
dependent just to separate the presentation layer from anything else.

So is ther a *@Shutdown* annotation just like the *@Startup* one ?

This is will mirror perfectly to the *contextInitialized* and *
contextDestroyed* methods implemented in context listeners usually
implemented for the same purpose in core servlets projects.

-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: Development decision regarding tapestry IoC (Application start-up and shutdown)

Posted by Muhammad Gelbana <m....@gmail.com>.
*I'm confused, to use the @Startup in your module class, then you need*
*the IoC jar to reference the @Startup annotation class!?*


I meant the shutdown mechanism explained in this page (
https://cwiki.apache.org/confluence/display/TAPESTRY/Tapestry+Inversion+of+Control+FAQ)
makes
my services tapestry dependent, not the start-up mechanism.

*Could you not have a class / service in your web teir that registers*
*with the RegistryShutdownHub, which then calls into your business*
*logic jar to shut it down?*


Very nice idea ! I'll start implementing it right away.
Thanks a lot :)

On Wed, Oct 5, 2011 at 11:34 AM, Steve Eynon <steve.eynon@alienfactory.co.uk
> wrote:

> Hiya,
>
> No, there is no @Shutdown method - as you say, you have to register
> with the RegistryShutdownHub.
>
> > I just don't wan't my jar to be tapestry dependent
>
> I'm confused, to use the @Startup in your module class, then you need
> the IoC jar to reference the @Startup annotation class!?
>
> Could you not have a class / service in your web teir that registers
> with the RegistryShutdownHub, which then calls into your business
> logic jar to shut it down?
>
> Steve.
>
>
> On 5 October 2011 17:04, Muhammad Gelbana <m....@gmail.com> wrote:
> > I have a current project that I am VERY close to converting all it's code
> > from core servlets to t5.2.6. But I have this project split to a jar file
> > containing most of the business logic, servicec, dao, etc.
> >
> > After intergrating this jar into the tapestry project, I need to start
> some
> > services and shut them down when I'm done.
> > For startup I use the *@Startup* annotation to mark a *static void*
> method
> > which runs a thread, initializing my services.
> >
> > About shutdown I found very nice information on this page:
> >
> https://cwiki.apache.org/confluence/display/TAPESTRY/Tapestry+Inversion+of+Control+FAQ
> >
> > But this implies carrying tapestry IoC jar along with my jar (because
> > services are annotated with tapestry IoC annotations) even in an
> environment
> > that doesn't use tapestry's IoC. I just don't wan't my jar to be tapestry
> > dependent just to separate the presentation layer from anything else.
> >
> > So is ther a *@Shutdown* annotation just like the *@Startup* one ?
> >
> > This is will mirror perfectly to the *contextInitialized* and *
> > contextDestroyed* methods implemented in context listeners usually
> > implemented for the same purpose in core servlets projects.
> >
> > --
> > *Regards,*
> > *Muhammad Gelbana
> > Java Developer*
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: Development decision regarding tapestry IoC (Application start-up and shutdown)

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Hiya,

No, there is no @Shutdown method - as you say, you have to register
with the RegistryShutdownHub.

> I just don't wan't my jar to be tapestry dependent

I'm confused, to use the @Startup in your module class, then you need
the IoC jar to reference the @Startup annotation class!?

Could you not have a class / service in your web teir that registers
with the RegistryShutdownHub, which then calls into your business
logic jar to shut it down?

Steve.


On 5 October 2011 17:04, Muhammad Gelbana <m....@gmail.com> wrote:
> I have a current project that I am VERY close to converting all it's code
> from core servlets to t5.2.6. But I have this project split to a jar file
> containing most of the business logic, servicec, dao, etc.
>
> After intergrating this jar into the tapestry project, I need to start some
> services and shut them down when I'm done.
> For startup I use the *@Startup* annotation to mark a *static void* method
> which runs a thread, initializing my services.
>
> About shutdown I found very nice information on this page:
> https://cwiki.apache.org/confluence/display/TAPESTRY/Tapestry+Inversion+of+Control+FAQ
>
> But this implies carrying tapestry IoC jar along with my jar (because
> services are annotated with tapestry IoC annotations) even in an environment
> that doesn't use tapestry's IoC. I just don't wan't my jar to be tapestry
> dependent just to separate the presentation layer from anything else.
>
> So is ther a *@Shutdown* annotation just like the *@Startup* one ?
>
> This is will mirror perfectly to the *contextInitialized* and *
> contextDestroyed* methods implemented in context listeners usually
> implemented for the same purpose in core servlets projects.
>
> --
> *Regards,*
> *Muhammad Gelbana
> Java Developer*
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org