T - the nature of the code able to handle the CommandFor<T> Objectspublic class ParallelCommandDispatcher<T> extends Object
BEWARE :
| Modifier and Type | Field and Description |
|---|---|
protected CopyOnWriteArrayList<T> |
list
List of all registered agent that may take action.
|
protected ExecutorService |
loop
ExecutorService that deals with the Threads handling the commands.
|
| Constructor and Description |
|---|
ParallelCommandDispatcher()
Creates an asynchronous Dispatcher for Commands.
|
ParallelCommandDispatcher(boolean singleThread) |
ParallelCommandDispatcher(ExecutorService execService)
Creates an asynchronous Dispatcher for Commands: uses a specific ExecutorService.
|
| Modifier and Type | Method and Description |
|---|---|
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
|
protected ExecutorService loop
protected CopyOnWriteArrayList<T> list
public ParallelCommandDispatcher()
public ParallelCommandDispatcher(ExecutorService execService)
public ParallelCommandDispatcher(boolean singleThread)
public void addExecutant(T executant)
executant - public void removeExecutant(T executant)
executant - public void dispatchCommand(CommandFor<T> command)
command - Copyright © 2015 LSST. All rights reserved.