You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by huntc <hu...@mac.com> on 2008/10/19 14:28:07 UTC

Life-cycle events for services hosted by CXFServlet

Hi there,

I was wondering if any life-cycle events are available/applicable to a CXF
service hosted by the CXFServlet?

My service allocates some resources and I was thinking that it would be tidy
to explicitly release those resources if the service was somehow stopped.

Is it possible for a service to become stopped once started? If so then how
would I go about intercepting such events?

Kind regards,
Christopher
-- 
View this message in context: http://www.nabble.com/Life-cycle-events-for-services-hosted-by-CXFServlet-tp20055641p20055641.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Life-cycle events for services hosted by CXFServlet

Posted by Glen Mazza <gl...@gmail.com>.
I would stop trying to think as web services as something that you
independently turn on or off, but of the corresponding *servlet* that hosts
them that you turn on and off (say, from the Tomcat manager web app or your
other servlet container's admin console).  In that sense, a web service is
no different from a web application.

So, no, your web service will never become "dormant", so long as the servlet
hosting it is continually running.

Glen


huntc wrote:
> 
> Hi Glen,
> 
> Thank you very much for your reply.
> 
> In the normal course of events, if using CXFServlet, is it normal for
> services to become dormant or do they remain active post-instantiation?
> 
> Kind regards,
> Christopher
> 
> 

-- 
View this message in context: http://www.nabble.com/Life-cycle-events-for-services-hosted-by-CXFServlet-tp20055641p20081275.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Life-cycle events for services hosted by CXFServlet

Posted by huntc <hu...@mac.com>.
Hi Glen,

Thank you very much for your reply.

In the normal course of events, if using CXFServlet, is it normal for
services to become dormant or do they remain active post-instantiation?

Kind regards,
Christopher

-- 
View this message in context: http://www.nabble.com/Life-cycle-events-for-services-hosted-by-CXFServlet-tp20055641p20079453.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Life-cycle events for services hosted by CXFServlet

Posted by Glen Mazza <gl...@gmail.com>.
You can probably just subclass CXFServlet--it has the standard HttpServlet's
destroy() and Spring's onApplicationEvent() methods that can be of use for
you:

http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java?revision=701830&view=markup

HTH,
Glen


huntc wrote:
> 
> Hi there,
> 
> I was wondering if any life-cycle events are available/applicable to a CXF
> service hosted by the CXFServlet?
> 
> My service allocates some resources and I was thinking that it would be
> tidy to explicitly release those resources if the service was somehow
> stopped.
> 
> Is it possible for a service to become stopped once started? If so then
> how would I go about intercepting such events?
> 
> Kind regards,
> Christopher
> 

-- 
View this message in context: http://www.nabble.com/Life-cycle-events-for-services-hosted-by-CXFServlet-tp20055641p20067489.html
Sent from the cxf-user mailing list archive at Nabble.com.