users@glassfish.java.net

Re: How to stop properly a timer ??

From: <glassfish_at_javadesktop.org>
Date: Mon, 01 Oct 2007 13:26:44 PDT

I generally use a LifeCycleListener instead of a servlet to initialise things - i think it is cleaner, but probably more hassle :( However you still cannot handle the shutdown/deployment case properly. When the shutdown event fires, the containers for the beans are already closing so you can't call a method to stop the timers (from memory). Also lifecycle modules can't detect un/redeployment.

I think from reading something before, it may be possible to right a mbean to detect deployment events, etc and handle the case from there?
[Message sent by forum member 'jsl123' (jsl123)]

http://forums.java.net/jive/thread.jspa?messageID=237900