Class ThreadPoolExecutor

java.lang.Object
de.uni_trier.wi2.procake.utils.concurrent.ThreadPoolExecutor

public class ThreadPoolExecutor extends Object
Author:
Christian Zeyen
  • Constructor Details

    • ThreadPoolExecutor

      public ThreadPoolExecutor()
    • ThreadPoolExecutor

      public ThreadPoolExecutor(int numberOfThreads)
  • Method Details

    • addTask

      public void addTask(Runnable task)
      Add a task to this executor to be executed by the available threads
      Parameters:
      task - task to add
    • clearTasks

      public void clearTasks()
      Clear all tasks that have been added to this executor
    • execute

      public void execute()
      Starts execution and waits for all submitted tasks to be executed.
    • isRunning

      public boolean isRunning()
    • getTimeoutMillis

      public long getTimeoutMillis()
    • setTimeoutMillis

      public void setTimeoutMillis(long timeoutMillis)
    • getNumberOfThreads

      public int getNumberOfThreads()
    • getTotalNumberOfTasks

      public int getTotalNumberOfTasks()
    • addListener

      public void addListener(ThreadPoolExecutorListener listener)
    • removeListener

      public void removeListener(ThreadPoolExecutorListener listener)