|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.lsst.ccs.utilities.dispatch.ParallelCommandDispatcher<T>
T - the nature of the code able to handle the CommandFor<T> Objectspublic class ParallelCommandDispatcher<T>
Dispatches a Command object to registered "executants" able to handle the command; each command execution may be handled by a different Thread so every registered agent does not have to wait for termination of code from the previous call.
BEWARE :
| Field Summary | |
|---|---|
protected java.util.concurrent.CopyOnWriteArrayList<T> |
list
List of all registered agent that may take action. |
protected java.util.concurrent.ExecutorService |
loop
ExecutorService that deals with the Threads handling the commands. |
| Constructor Summary | |
|---|---|
ParallelCommandDispatcher()
Creates an asynchronous Dispatcher for Commands. |
|
ParallelCommandDispatcher(java.util.concurrent.ExecutorService execService)
Creates an asynchronous Dispatcher for Commands: uses a specific ExecutorService. |
|
| Method Summary | |
|---|---|
void |
addExecutant(T executant)
adds an executant to the list of those going to execute Commands when needed. |
void |
dispatchCommand(CommandFor<T> command)
Send a Command request for all registered executants. |
void |
removeExecutant(T executant)
removes an executant form the list |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.concurrent.ExecutorService loop
protected java.util.concurrent.CopyOnWriteArrayList<T> list
| Constructor Detail |
|---|
public ParallelCommandDispatcher()
public ParallelCommandDispatcher(java.util.concurrent.ExecutorService execService)
| Method Detail |
|---|
public void addExecutant(T executant)
executant - public void removeExecutant(T executant)
executant - public void dispatchCommand(CommandFor<T> command)
command -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||