tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corey Baswell" <>
Subject Re: Spawn New Thread
Date Thu, 10 Jun 2004 13:04:26 GMT
Really I nead the thread to be up the lifetime of Tomcat which brings up 
another question. Right now I start thread in a static block of my servlet 
class (for example):

public class MyServelet .......

    MyThread myThread = new MyThread();

because I know MyServlet will be loaded when Tomcat is. This seems to work 
but is kind of "goofy" because the thread does not have a direct 
relationship with the servlet it's just the only place I know to kick it 
off.  Is there a better (or atleast more natural) place to start this 


>From: Tim Funk <>
>Reply-To: "Tomcat Users List" <>
>To: Tomcat Users List <>
>Subject: Re: Spawn New Thread
>Date: Wed, 09 Jun 2004 21:16:49 -0400
>If the thread is associated with a servlet. It would be best to use the 
>destroy method of the servlet to stop the thread.
>Corey Baswell wrote:
>>I'm trying to figure out what the proper way for spawning a new thread in 
>>Tomcat is.  I can create a new thread when my servlet is first loaded, but 
>>it does not get closed down when tomcat does. Is there anyway to register 
>>a new thread with Tomcat so that it will get closed when Tomcat goes down?
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message