org.mortbay.util
Class ThreadPool.PoolThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.mortbay.util.ThreadPool.PoolThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
ThreadPool

public static class ThreadPool.PoolThread
extends java.lang.Thread

Pool Thread run class. This class or derivations of it are recommended for use with the ThreadPool. The PoolThread allows the threads job to be retrieved and active status to be indicated.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ThreadPool.PoolThread(java.lang.Runnable r)
           
 
Method Summary
 java.lang.Object getJob()
           
 boolean isActive()
          Is the PoolThread active.
 void setActive(boolean active)
          Set active state.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadPool.PoolThread

public ThreadPool.PoolThread(java.lang.Runnable r)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Thread

getJob

public java.lang.Object getJob()

setActive

public void setActive(boolean active)
Set active state.
Parameters:
active -  

isActive

public boolean isActive()
Is the PoolThread active. A PoolThread handling a job, may set it's own active state. Implementation of of the ThreadPool.stopJob method should attempt to wait for active threads to complete.
Returns:
True if thread is active.


Copyright © GNU, wttools developers Team.