org.apache.axis2.util.threadpool
Class ThreadPool

java.lang.Object
  extended byorg.apache.axis2.util.threadpool.ThreadPool

public class ThreadPool
extends java.lang.Object

This the thread pool for axis2. This class will be used a singleton across axis2 engine. ThreadPool is accepts AxisWorkers which has doWork method on them and execute this method, using one of the threads in the thread pool.


Field Summary
protected static Log log
           
protected static long SLEEP_INTERVAL
           
 
Constructor Summary
ThreadPool()
           
 
Method Summary
 void addWorker(AxisWorker worker)
           
 void forceShutDown()
          A forceful shutdown mechanism for thread pool.
 AxisWorker getWorker()
           
 void safeShutDown()
          This is the recommended shutdown method for the thread pool This will wait till all the workers that are already handed over to the thread pool get executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Log log

SLEEP_INTERVAL

protected static long SLEEP_INTERVAL
Constructor Detail

ThreadPool

public ThreadPool()
Method Detail

addWorker

public void addWorker(AxisWorker worker)
               throws AxisFault
Throws:
AxisFault

getWorker

public AxisWorker getWorker()

safeShutDown

public void safeShutDown()
                  throws AxisFault
This is the recommended shutdown method for the thread pool This will wait till all the workers that are already handed over to the thread pool get executed.

Throws:
AxisFault

forceShutDown

public void forceShutDown()
A forceful shutdown mechanism for thread pool.