edu.utk.cs.icl.rest.util
Class ThreadPool

java.lang.Object
  extended byedu.utk.cs.icl.rest.util.ThreadPool

public class ThreadPool
extends Object

Creates a pool of threads in which things are run as a thread becomes available.


Constructor Summary
ThreadPool(int maxThreads)
          Construct a thread poll containing maxThreads threads.
 
Method Summary
 void add(Runnable exec)
          Add a Runnable object to the queue of threads to run.
 void finalize()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPool

public ThreadPool(int maxThreads)
Construct a thread poll containing maxThreads threads.

Parameters:
maxThreads - The number of threads to create in the pool. No more than this many threads will be running at a given time.
Method Detail

add

public void add(Runnable exec)
Add a Runnable object to the queue of threads to run.

Parameters:
exec - The runnable object to run on an available thread.

finalize

public void finalize()

stop

public void stop()

start

public void start()