|
JBoss Threads 2.0.0.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.threads.BalancingExecutor
public class BalancingExecutor
A simple load-balancing executor. If no delegate executors are defined, then tasks are rejected. Executors are chosen in a round-robin fashion.
Constructor Summary | |
---|---|
BalancingExecutor()
Construct a new instance. |
|
BalancingExecutor(Executor... executors)
Construct a new instance. |
Method Summary | |
---|---|
void |
addExecutor(Executor executor)
Add a delegate executor. |
void |
clear()
Clear out all delegate executors at once. |
void |
execute(Runnable command)
Execute a task. |
void |
removeExecutor(Executor executor)
Remove a delegate executor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BalancingExecutor()
public BalancingExecutor(Executor... executors)
executors
- the initial list of executors to delegate toMethod Detail |
---|
public void execute(Runnable command) throws RejectedExecutionException
execute
in interface Executor
command
- the task to execute
RejectedExecutionException
- if no executors are available to run the taskpublic void clear()
public void addExecutor(Executor executor)
executor
- the executor to addpublic void removeExecutor(Executor executor)
executor
- the executor to remove
|
JBoss Threads 2.0.0.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |