
public class AgentCommandDictionaryService extends Object implements ServiceLifecycle, AgentService
Command annotation. It also provides an API that can be used to
add commands to a given path from objects that are not on the lookup tree.
- client side command dictionary record keeping: for Consoles only. It listens
to the buses for the presence of Agents and it keeps an online snapshot
of the currently available dictionaries on the buses.
Rules to add command dictionaries:
- dictionaries can only be added in the HasLifecycle:init phase. All other
attempts will fail with a RuntimeException.
Dictionary publication on the status bus:
this service is responsible for publishing an Agent's command dictionary:
- every time a CONSOLE is connected to the buses
- upon startup as soon as the full dictionary is ready
the dictionary is published in a StatusCommandDicionary status message.| Modifier and Type | Class and Description |
|---|---|
class |
AgentCommandDictionaryService.AgentCommandDictionaryCommands |
static class |
AgentCommandDictionaryService.AgentCommandDictionaryEvent
An event fired to
AgentCommandDictionaryListeners when an agent
command dictionary has changed. |
static interface |
AgentCommandDictionaryService.AgentCommandDictionaryListener
A Listener to receive notifications of CommandDictionary changes.
|
| Constructor and Description |
|---|
AgentCommandDictionaryService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAgentCommandDictionaryListener(AgentCommandDictionaryService.AgentCommandDictionaryListener listener) |
void |
addCommandSetToObject(Object obj,
Object objectToAddTo)
Adds a
CommandSet to extend the set of commands recognized by this Agent. |
void |
afterInit() |
void |
afterStart() |
HashMap<String,Dictionary> |
getAgentCommandDictionary() |
AgentDictionaryCommand |
getAgentDictionaryCommand(String destination,
String commandName,
int nArgs)
Get an agent DictionaryCommand by name and with a given number of arguments
|
String |
getAgentServiceName()
Get the name of this service.
|
CommandSet |
getCommandSet(String name) |
long |
getDictionaryChecksum() |
void |
preInit() |
void |
preStart()
Called from the enclosing
Subsystem when
org.lsst.ccs.Subsystem#start() has been called. |
void |
removeAgentCommandDictionaryListener(AgentCommandDictionaryService.AgentCommandDictionaryListener listener) |
boolean |
startForAgent(AgentInfo agentInfo)
This method is invoked after an agent service is created to see if
this service is to be started for the tiven Agent.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpreBuild, preShutdownpublic String getAgentServiceName()
AgentServicegetAgentServiceName in interface AgentServicepublic boolean startForAgent(AgentInfo agentInfo)
AgentServicestartForAgent in interface AgentServicepublic void preInit()
preInit in interface ServiceLifecyclepublic void preStart()
ServiceLifecycleSubsystem when
org.lsst.ccs.Subsystem#start() has been called.
The preceding lifecycle step is HasLifecycle.postInit()
The following lifecycle step is HasLifecycle.start()
At the time it is called :
PhaseState is
INITIALIZING
connection with the messaging layer is effective, the enclosing
subsystem has started StatusHeartBeat
publication
preStart in interface ServiceLifecyclepublic void afterStart()
afterStart in interface ServiceLifecyclepublic void afterInit()
afterInit in interface ServiceLifecyclepublic long getDictionaryChecksum()
public CommandSet getCommandSet(String name)
public void addCommandSetToObject(Object obj, Object objectToAddTo)
CommandSet to extend the set of commands recognized by this Agent.obj - The object with the commandsobjectToAddTo - the object to add the commands to.public HashMap<String,Dictionary> getAgentCommandDictionary()
public AgentDictionaryCommand getAgentDictionaryCommand(String destination, String commandName, int nArgs)
public void addAgentCommandDictionaryListener(AgentCommandDictionaryService.AgentCommandDictionaryListener listener)
public void removeAgentCommandDictionaryListener(AgentCommandDictionaryService.AgentCommandDictionaryListener listener)
Copyright © 2020 LSST. All rights reserved.