public class JavaThreadPool extends java.lang.Object implements IThreadPool
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ExecutorService |
executor
The executor service.
|
protected boolean |
finished
Boolean if already finished.
|
protected java.util.List<IChangeListener<java.lang.Void>> |
listeners
The finished listeners.
|
| Constructor and Description |
|---|
JavaThreadPool()
Create a new ThreadPool5.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFinishListener(IChangeListener<java.lang.Void> listener)
Add a finish listener;
|
void |
dispose()
Shutdown the thread pool.
|
void |
execute(java.lang.Runnable task)
Execute a task in its own thread.
|
boolean |
isRunning()
Test if the thread pool is running.
|
protected void |
notifyFinishListeners()
Notify the finish listeners.
|
protected java.util.concurrent.ExecutorService executor
protected java.util.List<IChangeListener<java.lang.Void>> listeners
protected boolean finished
public void execute(java.lang.Runnable task)
execute in interface IThreadPooltask - The task to execute.public void dispose()
dispose in interface IThreadPoolpublic boolean isRunning()
isRunning in interface IThreadPoolpublic void addFinishListener(IChangeListener<java.lang.Void> listener)
addFinishListener in interface IThreadPoolprotected void notifyFinishListeners()