org.simoes.util
Class ThreadPool

java.lang.Object
  extended byorg.simoes.util.ThreadPool

public class ThreadPool
extends java.lang.Object

The Thread Pool will execute any threads passed in in a FIFO order. Available Thread will pick up any incoming requests. Any requests when all Threads are busy will be handled as soon as possible.

Author:
Chris Simoes

Constructor Summary
ThreadPool(int n)
           
 
Method Summary
 void add(java.lang.Runnable target)
          Use this to add to the Thread Pool.
 void closePool()
          Closes the ThreadPool.
 int getQueueSize()
          Returns the number of objects waiting for a thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPool

public ThreadPool(int n)
Method Detail

add

public void add(java.lang.Runnable target)
Use this to add to the Thread Pool.


closePool

public void closePool()
Closes the ThreadPool.


getQueueSize

public int getQueueSize()
Returns the number of objects waiting for a thread.