Hi Ian,

On Tuesday 23 June 2009, Ian Roberts wrote:
> Vassilis Virvilis wrote:
> > The actual point is can a webservice (pojo) be notified on undeploy?
> 
> If you don't mind coupling to Spring then just implement
> ServletContextAware and DisposableBean.  The former will cause Spring to
> inject the servlet context into your pojo (after calling the constructor
> but before it serves any requests), and latter defines a destroy()
> method that will be called when the web application shuts down.

Aaah the DisposableBean did actually the trick. Thanks a lot.

> 
> Alternatively you can get hold of the Spring ApplicationContext from
> your own listener by calling
> WebApplicationContextUtils.getWebApplicationContext(ServletContext), and
> from there you can get at your application beans and do whatever cleanup
> is necessary.
> 

That could be handy in other occasions. Thanks again


         Vassilis
 

Reply via email to