net.spy.concurrent
Class ThreadPoolObserver

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.concurrent.ThreadPoolObserver

public class ThreadPoolObserver
extends SpyObject

Receive notification of job completion.


Constructor Summary
ThreadPoolObserver()
          Get an instance of ThreadPoolObserver.
 
Method Summary
protected  void jobComplete(Runnable r)
          This method will be called to indicate the completion of a job.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPoolObserver

public ThreadPoolObserver()
Get an instance of ThreadPoolObserver.

Method Detail

jobComplete

protected void jobComplete(Runnable r)
This method will be called to indicate the completion of a job.

After jobComplete(Runnable) is called, a notifyAll will be sent letting anyone watching this thing know that something has occurred. jobComplete should be quick as to not get in the way of threads recycling. It will be called inside the ThreadPool's worker thread, but it is a synchronized call, so if it doesn't return quickly, it will prevent multiple threads from recycling.

Parameters:
r - the job that finished


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.