Constructor and Description |
---|
BalancingExecutor()
Construct a new instance.
|
BalancingExecutor(Executor... executors)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public BalancingExecutor()
public BalancingExecutor(Executor... executors)
executors
- the initial list of executors to delegate topublic void execute(Runnable command) throws RejectedExecutionException
execute
in interface Executor
command
- the task to executeRejectedExecutionException
- 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 removeCopyright © 2012 JBoss by Red Hat. All Rights Reserved.