Class ThreadPool
java.lang.Object
org.apache.axis.components.threadpool.ThreadPool
- Author:
- James M Snell (jasnell@us.ibm.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanstatic final intprotected static org.apache.commons.logging.Logprotected longprotected Map -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new worker to the poolvoidAwait shutdown of the workerbooleanawaitShutdown(long timeout) Await shutdown of the workervoidcleanup()longReturns the total number of currently active workersvoidForcefully interrupt all workersbooleanReturns true if all workers have been shutdownbooleanReturns true if all workers are in the process of shutting downvoidForcefully shutdown the poolvoidshutdown()Forcefully shutdown the poolvoidworkerDone(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
-