On Thu, Oct 16, 2008 at 1:50 PM, David Latorre <[EMAIL PROTECTED]> wrote:
> Niklas I do think that using Spring lifecycle is better than a
> ContextListener. For example, with Spring it is very easy to deploy the
> whole thing as a "resource adapter" instead of a web-application . Spring
>  v2 documentation states that this is useful when you need to deploy
> something to an application server where you would previously use an empty
> Web Applicaton.  It seems like our use case here!

I think it's better to adopt to the lifecycle of the container you
live in. In the case of a WAR, and since the Spring
ContextLoaderListener makes sure the application context is opened and
closed with the container lifecycle, it should work fine using init
and destroy methods (like Ralphs example). However, I would prefer to
have a explicit context listener that does that starting and stopping,
sure makes things a bit more controllable. At least in my brain, but
then again, I might be the kind of guy who likes things explicit and
less magic :-)

I'm not very familiar with developing resource adapters, but I assume
that there is a similar lifecycle there.

/niklas

Reply via email to