If upgrading Tomcat is possible, a context listener would be a better
design.




On Mon, 2004-10-18 at 15:51, Jonathan Wilson wrote:
> I have a <load-on-startup>1</load-on-startup> Servlet on TC3.3.1(under 
> RH7.3) which checks an XML file which contains a list of Runnable 
> classes to kick off at servlet startup. These child threads all belong 
> to the same threadgroup(however, not the same threadgroup of the spawner 
> servlet). These are daemon threads, and have the setDaemon(true) set for 
> the thread before I kickoff the runnable class. The problem I'm 
> experiencing is that when the context needs to be reloaded these child 
> threads are not killed, but continue to run. Since the context was 
> reloaded more threads of the same classes are kicked off - voila, 
> multiple threads responsible for the same thing(not desirable). I don't 
> think I can do a Singleton-type-thing since these old threads seem to be 
> running under a different JVM(via ppid) after context reload. I thought 
> that when only threads of Daemon type were left an application/parent 
> thread would die. I could of course implement an interface which 
> requires a yourDead() method and update all the child classes to check 
> to see if they should exit their infinite loops but I was hoping there 
> was a more elegant way.
> 
> Better design/good ideas??
> 
> Thanks,
>     JW
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to