tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: How do I listen for threads starting and stopping?
Date Thu, 29 May 2003 05:00:56 GMT
The simplest (portable) way to do this is to pretend that Threads are the
same as Requests, and use request.setAttribute("foo",bar).  These will
automatically be discarded (i.e. eligible for GC) at the end of the Request.
If you need to do explicit cleanup, then you have to wait for TC 5.x, which
has RequestListeners to tell you when the Request starts and ends.

"Kenneth H. Cox" <tclunit@attbi.com> wrote in message
news:oprpwig1cl3ocmvz@mail.attbi.com...
> I have some per-thread data that I need to dispose of
> when Tomcat connector thread goes away.  I'm using the
> Coyote Connector.  Is there a way to do it?  A Tomcat-specific
> mechanism is just fine for now, thank you.
>
> I found HttpConnector.addLifecycleListener(), but all the
> methods are marked deprecated and I'm not sure how to get at the
> HttpConnector in the first place.
>
> Any pointers in the right direction would be greatly appreciated.
>
> Regards,
> kenstir
>
> --
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message