Package org.apache.axis2.util.threadpool
Class ThreadPool
java.lang.Object
org.apache.axis2.util.threadpool.ThreadPool
- All Implemented Interfaces:
ThreadFactory
This the thread pool for axis2. This class will be used a singleton
across axis2 engine.
ThreadPool is accepts AxisWorkers which has
run method on them and execute this method, using one of the threads
in the thread pool.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ThreadPoolExecutorcreateDefaultExecutor(String name, int priority, boolean daemon) voidvoidA forceful shutdown mechanism for thread pool.voidThis 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.voidsetExecutor(ThreadPoolExecutor executor)
-
Field Details
-
SLEEP_INTERVAL
protected static long SLEEP_INTERVAL -
executor
-
-
Constructor Details
-
ThreadPool
public ThreadPool() -
ThreadPool
public ThreadPool(int corePoolSize, int maxPoolSize)
-
-
Method Details
-
getExecutor
-
setExecutor
-
execute
- Specified by:
executein interfaceThreadFactory
-
forceShutDown
public void forceShutDown()A forceful shutdown mechanism for thread pool. -
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.- Throws:
AxisFault
-
createDefaultExecutor
-