Class ThreadPool

Object
com.wowza.wms.vhost.ThreadPool

public class ThreadPool extends Object

ThreadPool: class for managing a pool of threads.

  • Constructor Details

    • ThreadPool

      public ThreadPool(IVHost vhost, String name)
      Create a new thread pool attached to a vHost.
      Parameters:
      vhost - vHost
  • Method Details

    • init

      public void init(int corePoolSize)
      Initialize threadPool.
      Parameters:
      corePoolSize - core pool size
    • terminate

      public void terminate()
      Terminate all threads and cleanup threadPool.
    • execute

      public 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 -
    • getExecutor

      public Executor getExecutor()
      Get the underlying Executor pool.
      Returns:
      Executor pool
    • getActiveCount

      public int getActiveCount()
      Get number of active threads.
      Returns:
      number of active threads
    • getQueueSize

      public int getQueueSize()
      Get the number of command objects in the LinkedBlockingQueue.
      Returns:
      number of command objects in the LinkedBlockingQueue