Jason,

On 2/6/06, Jason L. Buberel <[EMAIL PROTECTED]> wrote:
> That would explain why threadDidDiscardService() is not invoked. But is the
> use of the ThreadPoolExecutor also the cause of the finalize() method never
> being called?
>

I am not quite sure I follow you. The finalize() method on your
service implementation objects will not get called before
threadDidDiscardService() has been called as HiveMind still holds a
reference. I don't think you'll need a finalize() anyways.

> As for the cleanupThread() , I will read through the docs (and possibly steal
> some code from Tapestry :) to figure out what i need to do). It looks like I
> need to have each of the objects that I insert into my threadpool register
> listener themselves as listeners with the registry. Is that correct?
>

Registry.cleanupThread() is a convenience method. It is calling
ThreadEventNotifier.fireThreadCleanup(). The latter is a HiveMind
service: 
http://jakarta.apache.org/hivemind/hivedocs/service/hivemind.ThreadEventNotifier.html.

I think Tapestry is using the HiveMindFilter class which invokes
Registry.cleanupThread() after every processed request.

You should have every thread call
ThreadEventNotifier.fireThreadCleanup() or Registry.cleanupThread()
once it's done processing or being cancelled.

HTH,

--knut

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

Reply via email to