org.sadun.util.tp
Class ThreadPool.PooledThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.sadun.util.tp.ThreadPool.PooledThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
ThreadPool

public class ThreadPool.PooledThread
extends java.lang.Thread

A thread class that waits() undefinitely unless explicitly notified. When notified, it attempts to run the associated runnable. If no runnable exists, or when the runnable exits or fails, it goes back to waiting.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void finalize()
          Finalizes terminates the controlled threads.
protected  java.lang.Runnable getRunnable()
          Return the associated Runnable, or null
protected  boolean isFree()
          Return true if the thread is not associated to any runnable
 void run()
          Runs the available runnable object, or waits.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

run

public final void run()
Runs the available runnable object, or waits.


isFree

protected boolean isFree()
Return true if the thread is not associated to any runnable


getRunnable

protected java.lang.Runnable getRunnable()
Return the associated Runnable, or null

Returns:
the associated Runnable, or null

toString

public java.lang.String toString()

finalize

public void finalize()
Finalizes terminates the controlled threads.