public class ThreadPool extends Object implements ThreadFactory
ThreadPool
is accepts AxisWorkers
which has
run method on them and execute this method, using one of the threads
in the thread pool.Modifier and Type | Field and Description |
---|---|
protected ThreadPoolExecutor |
executor |
protected static long |
SLEEP_INTERVAL |
Constructor and Description |
---|
ThreadPool() |
ThreadPool(int corePoolSize,
int maxPoolSize) |
Modifier and Type | Method and Description |
---|---|
protected ThreadPoolExecutor |
createDefaultExecutor(String name,
int priority,
boolean daemon) |
void |
execute(Runnable worker) |
void |
forceShutDown()
A forceful shutdown mechanism for thread pool.
|
Executor |
getExecutor() |
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.
|
void |
setExecutor(ThreadPoolExecutor executor) |
protected static long SLEEP_INTERVAL
protected ThreadPoolExecutor executor
public ThreadPool()
public ThreadPool(int corePoolSize, int maxPoolSize)
public Executor getExecutor()
public void setExecutor(ThreadPoolExecutor executor)
public void execute(Runnable worker)
execute
in interface ThreadFactory
public void forceShutDown()
public void safeShutDown() throws AxisFault
AxisFault
protected ThreadPoolExecutor createDefaultExecutor(String name, int priority, boolean daemon)
Copyright © The Apache Software Foundation. All Rights Reserved.