Hi Vassilis

Is it possible for you to use a Spring's ability to call a user-designated destroy method ? This will probably be called though when the whole webapp is undeployed as at the moment we don't support any other Spring lifecycles like prototype. etc.Or may be @PreDestroy would help you ?http://java.sun.com/javase/6/docs/api/javax/annotation/PreDestroy.htmlif it does than I can make it work by the time 2.2.3 gets released by the end of July. cheers, Sergey----- Original Message ----- From: "Vassilis Virvilis" <[email protected]>
To: "Sergey Beryozkin" <[email protected]>
Cc: <[email protected]>
Sent: Tuesday, June 23, 2009 10:53 AM
Subject: Re: How to get servlet context at initialization time of a POJO


Hi Sergey,

Thanks for replying

On Tuesday 23 June 2009, Sergey Beryozkin wrote:
Hi,


The only way to do it at the moment is to use a per-request resource class with @Context ServletContext being one of the constructor
parameters

I can't do that at the moment. My servlet must have application-scope. I guess I didn't mention that, mainly because I was frustrated by the time I decided to post on the list after 3 hours of googling around.

A little background info.

My web services have some memory leaks that I am hunting down. I found the leaks but in order to plug them I need to run some code during undeploy. I can use

 <listener>
   <listener-class>
 com.mypackage.CleanupContextListener
   </listener-class>
 </listener>

but then I don't have access to webservices specific variables and I don't want to export them through getters and setters and static variables.


The actual point is can a webservice (pojo) be notified on undeploy?


           Vassilis



Reply via email to