Class ThreadPoolExecutor
- java.lang.Object
-
- de.uni_trier.wi2.procake.utils.concurrent.ThreadPoolExecutor
-
public class ThreadPoolExecutor extends Object
- Author:
- Christian Zeyen
-
-
Constructor Summary
Constructors Constructor Description ThreadPoolExecutor()ThreadPoolExecutor(int numberOfThreads)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ThreadPoolExecutorListener listener)voidaddTask(Runnable task)Add a task to this executor to be executed by the available threadsvoidexecute()Starts execution and waits for all submitted tasks to be executed.intgetNumberOfThreads()longgetTimeoutMillis()intgetTotalNumberOfTasks()voidremoveListener(ThreadPoolExecutorListener listener)voidsetTimeoutMillis(long timeoutMillis)
-
-
-
Method Detail
-
addTask
public void addTask(Runnable task)
Add a task to this executor to be executed by the available threads- Parameters:
task- task to add
-
execute
public void execute()
Starts execution and waits for all submitted tasks to be executed.
-
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)
-
-