On Fri, Oct 29, 2004 at 10:20:49AM -0400, Shapira, Yoav wrote:
> >Should have remembered that, I've used it before ::blush:: . I didn't
> >consider it as the thread I'm looking at is deep within the business
> >logic and doesn't have access to the Context.
>
> That it gets trickier. You can use the Runtime#addShutdownHook
> approach, but that only applies when the JVM is shutting down, so it
> won't work for a webapp reload.
one way to solve that is to create a singleton class that is the
ServletContextListener and have your business threads register themselves
with it. Basically use the same interface as Runtime#addShutdownHook
but implement it to be triggered on actions local to your app.
This also helps keep the tomcat specific code and the core business
logic code separate. (if you have you app designed that way)
eric
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]