Class ThreadPool
java.lang.Object
org.apache.axis.components.threadpool.ThreadPool
- Author:
- James M Snell (jasnell@us.ibm.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
static final int
protected static org.apache.commons.logging.Log
protected long
protected Map
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new worker to the poolvoid
Await shutdown of the workerboolean
awaitShutdown
(long timeout) Await shutdown of the workervoid
cleanup()
long
Returns the total number of currently active workersvoid
Forcefully interrupt all workersboolean
Returns true if all workers have been shutdownboolean
Returns true if all workers are in the process of shutting downvoid
Forcefully shutdown the poolvoid
shutdown()
Forcefully shutdown the poolvoid
workerDone
(Runnable worker, boolean restart) Used by MessageWorkers to notify the pool that it is done
-
Field Details
-
log
protected static org.apache.commons.logging.Log log -
DEFAULT_MAX_THREADS
public static final int DEFAULT_MAX_THREADS- See Also:
-
threads
-
threadcount
protected long threadcount -
_shutdown
public boolean _shutdown
-
-
Constructor Details
-
ThreadPool
public ThreadPool() -
ThreadPool
public ThreadPool(int maxPoolSize)
-
-
Method Details
-
cleanup
- Throws:
InterruptedException
-
isShutdown
public boolean isShutdown()Returns true if all workers have been shutdown -
isShuttingDown
public boolean isShuttingDown()Returns true if all workers are in the process of shutting down -
getWorkerCount
public long getWorkerCount()Returns the total number of currently active workers -
addWorker
Adds a new worker to the pool -
interruptAll
public void interruptAll()Forcefully interrupt all workers -
shutdown
public void shutdown()Forcefully shutdown the pool -
safeShutdown
public void safeShutdown()Forcefully shutdown the pool -
awaitShutdown
Await shutdown of the worker- Throws:
InterruptedException
-
awaitShutdown
Await shutdown of the worker- Throws:
InterruptedException
-
workerDone
Used by MessageWorkers to notify the pool that it is done
-