tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mufaddal Khumri <>
Date Mon, 03 Nov 2003 03:28:12 GMT

I have an instance of MyMailScheduler - mmsched in a ContextListener 
class for my webapp. mmsched spawns threads to do some work regarding 
sending emails. In my contextDestroy method I do : mmsched = null;

I was under the impression that if tomcat was shutdown or the webapp 
was stopped my threads would be automatically killed since mmsched 
would be garbage collected. Am I understanding this right or do I need 
to do something else ?

  My webapp does two mail related tasks for two different sets of data. 
Both tasks are identical and therefore I spawn two threads. The two 
threads do not share any data structures. Also do I need to make the 
run() method synchronized ?


On Monday, November 3, 2003, at 08:45  PM, IvanLatysh wrote:

> Hello, Prince!
> You wrote to "Tomcat Users List" <> on 
> Sat, 1 Nov 2003 13:21:42 +0530:
>  P> Hi,
>  P>  I need to send a mail automatically at 10 minutes interval. how 
> can
>  P> i do this? how can i activate threads in tomcat?
> Tomcat is a Java application, there are no difference of using threads 
> with Tomcat or without it.
> Simply expand Thread class, and run your thread.
> But don't forget to notify and kill your thread when Tomcat is 
> shutting down.
> Here is a link that might help you.
> ---
> Regards
> Ivan[a]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message