Package com.wowza.wms.vhost
Class ThreadPool
- Object
- 
- com.wowza.wms.vhost.ThreadPool
 
- 
 public class ThreadPool extends ObjectThreadPool: class for managing a pool of threads. 
- 
- 
Constructor SummaryConstructors Constructor Description ThreadPool(IVHost vhost, String name)Create a new thread pool attached to a vHost.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(Runnable command)Execute a runnable object.intgetActiveCount()Get number of active threads.java.util.concurrent.ExecutorgetExecutor()Get the underlying Executor pool.intgetQueueSize()Get the number of command objects in the LinkedBlockingQueue.voidinit(int corePoolSize)Initialize threadPool.voidterminate()Terminate all threads and cleanup threadPool.
 
- 
- 
- 
Constructor Detail- 
ThreadPoolpublic ThreadPool(IVHost vhost, String name) Create a new thread pool attached to a vHost.- Parameters:
- vhost- vHost
 
 
- 
 - 
Method Detail- 
initpublic void init(int corePoolSize) Initialize threadPool.- Parameters:
- corePoolSize- core pool size
 
 - 
terminatepublic void terminate() Terminate all threads and cleanup threadPool.
 - 
executepublic void execute(Runnable command) Execute a runnable object. If the threadPool is at the corePool size, the object will be added to a LinkedBlockingQueue in the order it was received.- Parameters:
- command-
 
 - 
getExecutorpublic java.util.concurrent.Executor getExecutor() Get the underlying Executor pool.- Returns:
- Executor pool
 
 - 
getActiveCountpublic int getActiveCount() Get number of active threads.- Returns:
- number of active threads
 
 - 
getQueueSizepublic int getQueueSize() Get the number of command objects in the LinkedBlockingQueue.- Returns:
- number of command objects in the LinkedBlockingQueue
 
 
- 
 
-