PDA

View Full Version : Trapping Webapp restarts


teledyn
10-09-2009, 03:18 PM
When a war file is updated, Resin will shutdown, unpack and restart the webapp; is there a method that gets called on the webapp servlet to notify the application to do any needed housekeeping?

I have tried destroy(), it is never called, and finalize() is called when the resin server itself is killed, but not called when the webapp is reloaded. Should I be using some caucho extension to the basic javax HttpServlet?

I am using Resin 3.0; please feel free to just point me at the pertinent documentation ;) -- thanks in advance for your advice on this.

teledyn
10-12-2009, 03:09 PM
You have to wonder what goes through Muggboot's mind posting that garbage in a place like this. Is it just for the SEO they hope to get from the link? don't they realize there are just as many or more people who will see the spam and vow never ever to buy that crap, and to recommend the same to everyone who mentions the brand name?

ferg
10-12-2009, 03:55 PM
thanks for the spam report. I think it's a business, because we get about 20-30 spams forum postings a day (that's why it's moderated.) Even though no one ever sees the moderated posts, they still post 20 a day.

ferg
10-13-2009, 02:22 PM
The easiest is either a load-on-startup servlet with a void destroy() method, or a ServletContextListener registered using <listener> in the resin-web.xml.

teledyn
10-26-2009, 02:50 PM
I had the load-on-startup servlet with a void destroy() and while it was called when the resin is shutdown, it wasn't called when a servlet is restarted due to a war file update; I'll double check that to be certain, and I'll also check out the servletContextListener config.

thanks for the tip (and the spam removal ;)