Hi,
>Really I nead the thread to be up the lifetime of Tomcat
No, you don't: at most you need the thread to be up for the lifetime of
your webapp. If you really need it to be up for the lifetime of tomcat,
that's pretty terrible design.
>because I know MyServlet will be loaded when Tomcat is. T
rt this
thread?
Thanks,
Corey
From: Tim Funk <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: Tomcat Users List <[EMAIL PROTECTED]>
Subject: Re: Spawn New Thread
Date: Wed, 09 Jun 2004 21:16:49 -0400
If the thread is associated with a servlet.
t;From: Tim Funk [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, June 09, 2004 9:17 PM
>To: Tomcat Users List
>Subject: Re: Spawn New Thread
>
>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
>
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
loa
Thread t = new Thread();
t.setDaemon(true);
t.start();
- Original Message -
From: "Corey Baswell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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 t
Thread t = new Thread();
t.setDaemon(true);
t.start();
- Original Message -
From: "Corey Baswell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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 t
You need to make your thread a daemon thread by calling:
myThread.setDaemon(true);
That will take care of the shutdown problem.
Frank
From: "Corey Baswell" <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Spawn New Thread
Date: Wed, 09 Jun 2004 16