On Wed, 05 Oct 2011 06:04:08 -0300, Muhammad Gelbana <m.gelb...@gmail.com> wrote:

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.

You don't need to use any annotation in your service classes. Use constructor injection, so you don't need @Inject. For startup and shutdown listeners, you can register them through a module class outside of your services JAR. This way, you can have it completely independent of Tapestry-IoC.

In addition, since 5.3, you can use the JSR 330 annotations instead of Tapestry-IoC ones: http://tapestry.apache.org/using-jsr-330-standard-annotations.html

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

@Startup, as far as I can remember, is just a shortcut for contributing a service to the RegistryStartup. As Steve said, RegistryShutdownHub does the same, but for shutdown. Registering your services in these two services replaces the use of the contextInitialized and contextDestroyed* methods implemented in context listeners.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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

Reply via email to