public class ThreadPool
extends Object
ThreadPool: class for managing a pool of threads.
| Constructor and Description |
|---|
ThreadPool(IVHost vhost,
String name)
Create a new thread pool attached to a vHost.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable command)
Execute a runnable object.
|
int |
getActiveCount()
Get number of active threads.
|
java.util.concurrent.Executor |
getExecutor()
Get the underlying Executor pool.
|
int |
getQueueSize()
Get the number of command objects in the LinkedBlockingQueue.
|
void |
init(int corePoolSize)
Initialize threadPool.
|
void |
terminate()
Terminate all threads and cleanup threadPool.
|
public ThreadPool(IVHost vhost, String name)
vhost - vHostpublic void execute(Runnable command)
command - public int getActiveCount()
public java.util.concurrent.Executor getExecutor()
public int getQueueSize()
public void init(int corePoolSize)
corePoolSize - core pool sizepublic void terminate()