Class PausableThreadPoolExecutor

  • All Implemented Interfaces:
    Executor, ExecutorService

    public class PausableThreadPoolExecutor
    extends ThreadPoolExecutor
    This class define a Pausable thread pool executor. This class is based on the javadoc documentation of the ThreadPoolExecutor class.
    Since:
    2.0
    • Constructor Detail

      • PausableThreadPoolExecutor

        public PausableThreadPoolExecutor​(int threadNumber)
        public constructor.
        Parameters:
        threadNumber - number of threads
    • Method Detail

      • submit

        public <T> Future<T> submit​(Runnable task,
                                    T result,
                                    int requiredProcessors)
        Submit a task.
        Parameters:
        task - the task to submmit
        result - the result
        requiredProcessors - the required processor number
        Returns:
        a Future task
      • pause

        public void pause()
        Pause the executor.
      • resume

        public void resume()
        Resume the executor.