Class PausableThreadPoolExecutor

All Implemented Interfaces:
Executor, ExecutorService
Direct Known Subclasses:
PausablePriorityThreadPoolExecutor

public class PausableThreadPoolExecutor extends ThreadPoolExecutor
Pausable ThreadPoolExecutor. This class is for internal use.
Author:
Kimberly
  • Constructor Details

    • PausableThreadPoolExecutor

      public PausableThreadPoolExecutor()
      Create a PausableThreadPoolExecutor with core/maximum pool size set to one.
    • PausableThreadPoolExecutor

      public PausableThreadPoolExecutor(String poolPrefix, int corePoolSize, int maximumPoolSize)
      Create a PausableThreadPoolExecutor with specified parameters.
      Parameters:
      poolPrefix - prefix name of thread pool
      corePoolSize - core pool size
      maximumPoolSize - maximum pool size
    • PausableThreadPoolExecutor

      public PausableThreadPoolExecutor(String poolPrefix, int corePoolSize, int maximumPoolSize, int queueSize)
      Create a PausableThreadPoolExecutor with specified parameters.
      Parameters:
      poolPrefix - prefix name of thread pool
      corePoolSize - core pool size
      maximumPoolSize - maximum pool size
      queueSize - the maximum queue size used for holding tasks before they are executed
    • PausableThreadPoolExecutor

      public PausableThreadPoolExecutor(String poolPrefix, int corePoolSize, int maximumPoolSize, Consumer<Runnable> afterExecuteFunc)
      Create a PausableThreadPoolExecutor with specified parameters.
      Parameters:
      poolPrefix - prefix name of thread pool
      corePoolSize - core pool size
      maximumPoolSize - maximum pool size
      afterExecuteFunc - the function to execute after any task is executed
    • PausableThreadPoolExecutor

      public PausableThreadPoolExecutor(String poolPrefix, int corePoolSize, int maximumPoolSize, int queueSize, Consumer<Runnable> afterExecuteFunc)
      Create a PausableThreadPoolExecutor with specified parameters.
      Parameters:
      poolPrefix - prefix name of thread pool
      corePoolSize - core pool size
      maximumPoolSize - maximum pool size
      queueSize - the maximum queue size used for holding tasks before they are executed
      afterExecuteFunc - the function to execute after any task is executed
    • PausableThreadPoolExecutor

      public PausableThreadPoolExecutor(String poolPrefix, int corePoolSize, int maximumPoolSize, int queueSize, long keepAliveTime, TimeUnit unit, Consumer<Runnable> afterExecuteFunc)
      Create a PausableThreadPoolExecutor with specified parameters.
      Parameters:
      poolPrefix - prefix name of thread pool
      corePoolSize - core pool size
      maximumPoolSize - maximum pool size
      queueSize - the maximum queue size used for holding tasks before they are executed
      keepAliveTime - when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
      unit - the time unit for the keepAliveTime argument
      afterExecuteFunc - the function to execute after any task is executed
    • PausableThreadPoolExecutor

      public PausableThreadPoolExecutor(String poolPrefix, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, Consumer<Runnable> afterExecuteFunc)
      Create a PausableThreadPoolExecutor with specified parameters.
      Parameters:
      poolPrefix - prefix name of thread pool
      corePoolSize - core pool size
      maximumPoolSize - maximum pool size
      keepAliveTime - when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
      unit - the time unit for the keepAliveTime argument
      workQueue - the queue used for holding tasks before they are executed
      threadFactory - the factory to use when the executor creates a new thread
      afterExecuteFunc - the function to execute after any task is executed
  • Method Details