|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface WorkerPool
The WorkerPool interface models an abstract pool of workers
(threads) which can execute WorkerTasks concurrently.
| Method Summary | |
|---|---|
void |
cancel()
Cancels all threads non-blocking by interrupting them. |
void |
execute(WorkerTask task)
Executes a task on behalf of this worker pool. |
boolean |
isIdle()
Checks if all workers of the pool are idle. |
void |
stop()
Stops all threads in this worker pool gracefully. |
boolean |
tryToExecute(WorkerTask task)
Tries to execute a task on behalf of this worker pool. |
| Method Detail |
|---|
void execute(WorkerTask task)
task - a Runnable to execute.boolean tryToExecute(WorkerTask task)
false. Otherwise the task
is executed in background.
task - a Runnable to execute.
true if the task is executing.void stop()
void cancel()
boolean isIdle()
true if all workers are idle.
|
Copyright 2003-2009 Frank Fock and Jochen Katz (SNMP4J.org) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||