RE: Starting a Clean-up program
If you create that as a servlet, you can set the startup to 1 which will call it each time the webserver starts. Is that what you are looking for? servletname com.skp.someclass hello world 1 When the server starts it sees this class as a startup class and immediately executes its init. Scott Purcell Vertis Corporation -Original Message- From: Chandra Gottipati [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 9:45 AM To: Tomcat Users List Subject: Starting a Clean-up program I have a static method that starts a thread with a class that does some clean-up tasks. public static void init(){ Thread t = new Thread( new ClearUserHashMapClient() ); t.start(); }//init How can I configure my webapp to call this init() method when I deploy my war file on Tomcat. Thanks, Chandra. - 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: Starting a Clean-up program
Howdy, Implement a javax.servlet.ServletContextListener, and call that init method in the listener's contextInitialized() event. Don't forget to put the listener in your webapp's web.xml file. > public static void init(){ >Thread t = new Thread( new ClearUserHashMapClient() ); >t.start(); > }//init > >How can I configure my webapp to call this init() method when I deploy my >war file on Tomcat. Yoav Shapira Millennium ChemInformatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Starting a Clean-up program
I have a static method that starts a thread with a class that does some clean-up tasks. public static void init(){ Thread t = new Thread( new ClearUserHashMapClient() ); t.start(); }//init How can I configure my webapp to call this init() method when I deploy my war file on Tomcat. Thanks, Chandra. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]