|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The ThreadPool manages a pool of threads.
In the thread pool, as its name suggests, some threads are waiting for
work to appear in the pool. As soon as there is work one of the waiting threads will take it and work on it.
The pool has an initial amount of threads which are created when the pool
is created. It has also a maximum limit to which he can extend the number
of threads. When work is added and no thread is currently waiting, the
pool creates a new thread unless the maximum count of threads is already reached.
Currently the pool does not destroy any thread he once created.
| Method Summary | |
void |
cancel(java.lang.Runnable work)
Add work which will be eventually done by one of the threads in this pool. |
void |
execute(java.lang.Runnable work)
Add work which will be eventually done by one of the threads in this pool. |
int |
getCurrentPoolSize()
Gets the number of threads in this pool. |
void |
resumePool()
Stop a pool. |
void |
startPool()
Stop a pool. |
void |
stopPool()
Stop a pool. |
void |
suspendPool()
Stop a pool. |
| Method Detail |
public void execute(java.lang.Runnable work)
throws ThreadPoolStoppedException
work - the work to dopublic void cancel(java.lang.Runnable work)
work - the work to dopublic int getCurrentPoolSize()
public void stopPool()
public void startPool()
public void suspendPool()
public void resumePool()
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||