tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Extra Threads in background
Date Sun, 03 May 2009 20:33:19 GMT
> From: David.Meldrum [mailto:david.meldrum@verizon.net]
> Subject: Re: Extra Threads in background
> 
> I did not call the "destroy()" method because I though it was 
> deprecated and dangerous.

I believe Chris meant the ServletContextListener.contextDestroyed() method, not Thread.destroy();
the latter should never be used.

Your extra thread should not have to wake up more often to check the terminate flag; the code
in your contextDestroyed() method should simply interrupt the extra thread, which will then
wake up from its sleep() or wait() call.

As far as your having two instances of your extra thread running, your webapp might be getting
deployed twice.  Poorly constructed server.xml and context.xml configs can easily cause this.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


Mime
View raw message