public class ThreadPool extends java.lang.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 java.util.concurrent.ThreadPoolExecutor |
executor |
protected static long |
SLEEP_INTERVAL |
| Constructor and Description |
|---|
ThreadPool() |
ThreadPool(int corePoolSize,
int maxPoolSize) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.concurrent.ThreadPoolExecutor |
createDefaultExecutor(java.lang.String name,
int priority,
boolean daemon) |
void |
execute(java.lang.Runnable worker) |
void |
forceShutDown()
A forceful shutdown mechanism for thread pool.
|
java.util.concurrent.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(java.util.concurrent.ThreadPoolExecutor executor) |
protected static long SLEEP_INTERVAL
protected java.util.concurrent.ThreadPoolExecutor executor
public ThreadPool()
public ThreadPool(int corePoolSize,
int maxPoolSize)
public java.util.concurrent.Executor getExecutor()
public void setExecutor(java.util.concurrent.ThreadPoolExecutor executor)
public void execute(java.lang.Runnable worker)
execute in interface ThreadFactorypublic void forceShutDown()
public void safeShutDown()
throws AxisFault
AxisFaultprotected java.util.concurrent.ThreadPoolExecutor createDefaultExecutor(java.lang.String name,
int priority,
boolean daemon)
Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.