Class ThreadPoolExecutor
java.lang.Object
de.uni_trier.wi2.procake.utils.concurrent.ThreadPoolExecutor
- Author:
- Christian Zeyen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(ThreadPoolExecutorListener listener) void
Add a task to this executor to be executed by the available threadsvoid
Clear all tasks that have been added to this executorvoid
execute()
Starts execution and waits for all submitted tasks to be executed.int
long
int
boolean
void
removeListener
(ThreadPoolExecutorListener listener) void
setTimeoutMillis
(long timeoutMillis)
-
Constructor Details
-
ThreadPoolExecutor
public ThreadPoolExecutor() -
ThreadPoolExecutor
public ThreadPoolExecutor(int numberOfThreads)
-
-
Method Details
-
addTask
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
-
removeListener
-