RE: stopping all the java threads when tomcat stops
Yoav, Thank you, we tried to stop using scheduler.shutdown method in quartz servlet's destroy method but it is not working as expected. Also I would like to clarify one more doubt when load-on-startup method called will it call init method of the servlet all the time.ie. Even when tomcat remove the servlet when it is not used for long time and again calls back when load increased. -Jignesh On Wed, 2004-08-11 at 09:30, Shapira, Yoav wrote: Hi, Years ago, I posted a SystemThreadList class to the mailing list: search the archives. It will let you access and stop any thread in your JVM. Of course if you're running with a security manager, you would need to configure the policy file appropriately. However, instead of doing this brute-force approach, try looking for a Quartz shutdown method that will stop all its threads more gracefully. In fact, a casual glance at the JavaDoc shows Scheduler#shutdown which should do what you want. Yoav Shapira Millennium Research Informatics -Original Message- From: Jignesh Patel [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 6:58 PM To: Tomcat Users List Subject: stopping all the java threads when tomcat stops Hi All, As on previous topic we discussed for developing listener to stop the application. Now our confusion is we are using quartz application with tomcat, so when we stop the tomcat it never stops. We want to develop a listener which listens on stopping the server and in turn stops all the running threads. We used garbage collector and context listener but we couldn't able to do it. Any suggestion appreciated in this topic. -Jignesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stopping all the java threads when tomcat stops
On Thu, Aug 12, 2004 at 11:57:04AM -0400, Jignesh Patel wrote: : Thank you, we tried to stop using scheduler.shutdown method in quartz : servlet's destroy method but it is not working as expected. You *really* want to use a ContextListener for this: it provides the equivalents of a servlet's init() and destroy() but for the entire webapp. In turn, those are only called when the webapp is activated and deactivated, for lack of better terminology. ;) : Also I would like to clarify one more doubt when load-on-startup method : called will it call init method of the servlet all the time.ie. Even : when tomcat remove the servlet when it is not used for long time and : again calls back when load increased. Servlet#init() Called by the servlet container to indicate to a servlet that the servlet is being placed into service. The servlet container calls the init method exactly once after instantiating the servlet. The init method must complete successfully before the servlet can receive any requests. The servlet container cannot place the servlet into service if the init method (J2EE docs) So if a servlet is taken in and out of service during a context's runtime... -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stopping all the java threads when tomcat stops
Hi, Years ago, I posted a SystemThreadList class to the mailing list: search the archives. It will let you access and stop any thread in your JVM. Of course if you're running with a security manager, you would need to configure the policy file appropriately. However, instead of doing this brute-force approach, try looking for a Quartz shutdown method that will stop all its threads more gracefully. In fact, a casual glance at the JavaDoc shows Scheduler#shutdown which should do what you want. Yoav Shapira Millennium Research Informatics -Original Message- From: Jignesh Patel [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 6:58 PM To: Tomcat Users List Subject: stopping all the java threads when tomcat stops Hi All, As on previous topic we discussed for developing listener to stop the application. Now our confusion is we are using quartz application with tomcat, so when we stop the tomcat it never stops. We want to develop a listener which listens on stopping the server and in turn stops all the running threads. We used garbage collector and context listener but we couldn't able to do it. Any suggestion appreciated in this topic. -Jignesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]