You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Corey Baswell <co...@hotmail.com> on 2004/06/09 23:18:24 UTC
Spawn New Thread
Hello,
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?
Thanks for any help,
Corey
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Spawn New Thread
Posted by Tim Funk <fu...@joedog.org>.
If the thread is associated with a servlet. It would be best to use the
destroy method of the servlet to stop the thread.
-Tim
Corey Baswell wrote:
> Hello,
>
> 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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Spawn New Thread
Posted by Filip Hanik - Dev <de...@hanik.com>.
Thread t = new Thread();
t.setDaemon(true);
t.start();
----- Original Message -----
From: "Corey Baswell" <co...@hotmail.com>
To: <to...@jakarta.apache.org>
Sent: Wednesday, June 09, 2004 4:18 PM
Subject: Spawn New Thread
> Hello,
>
> 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?
>
> Thanks for any help,
> Corey
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org