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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterBuild, afterStart, preShutdown, preStartpublic String getAgentServiceName()
AgentServicegetAgentServiceName in interface AgentServicepublic boolean startForAgent(AgentInfo agentInfo)
AgentServicestartForAgent in interface AgentServicepublic void preBuild()
preBuild in interface ServiceLifecyclepublic void preInit()
preInit 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 HashMap<String,Dictionary> getAgentCommandDictionaryWithoutAgentName()
public AgentDictionaryCommand getAgentDictionaryCommand(String destination, String commandName, int nArgs)
destination - Target component, including the subsystem name.commandName - Command name.nArgs - Number of arguments the command takes.AgentDictionaryCommand.RuntimeException - If the dictionary is not available, or a matching command is not found.public void addAgentCommandDictionaryListener(AgentCommandDictionaryService.AgentCommandDictionaryListener listener)
public void removeAgentCommandDictionaryListener(AgentCommandDictionaryService.AgentCommandDictionaryListener listener)
Copyright © 2023 LSST. All rights reserved.