Package org.lsst.ccs.services
Class MessagingService
java.lang.Object
org.lsst.ccs.services.MessagingService
- All Implemented Interfaces:
Dispatcher.Listener,ServiceLifecycle,AgentService
public class MessagingService
extends Object
implements AgentService, ServiceLifecycle, Dispatcher.Listener
An AgentService that manages the underlying messaging service.
- Author:
- The LSST CCS Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGet the name of this service.ReturnsAgentMessagingLayerused by thisAgent.booleanReturnstrueonce the Agent has been connected to the buses.voidonEvent(Dispatcher.Event event) voidpreBuild()voidpreStart()Called from the enclosingSubsystemwhenorg.lsst.ccs.Subsystem#start()has been called.booleanstartForAgent(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lsst.ccs.ServiceLifecycle
afterInit, afterStart, preInit, preShutdown
-
Constructor Details
-
MessagingService
public MessagingService()
-
-
Method Details
-
getAgentServiceName
Description copied from interface:AgentServiceGet the name of this service. This name will be used to add the given service to the lookup tree.- Specified by:
getAgentServiceNamein interfaceAgentService- Returns:
- the AgentService name.
-
startForAgent
Description copied from interface:AgentServiceThis method is invoked after an agent service is created to see if this service is to be started for the tiven Agent.- Specified by:
startForAgentin interfaceAgentService- Returns:
- true if the service is to be added to the given agent.
-
preBuild
public void preBuild()- Specified by:
preBuildin interfaceServiceLifecycle
-
afterBuild
public void afterBuild()- Specified by:
afterBuildin interfaceServiceLifecycle
-
preStart
public void preStart()Description copied from interface:ServiceLifecycleCalled from the enclosingSubsystemwhenorg.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 :-
the
PhaseStateisINITIALIZINGconnection with the messaging layer is effective, the enclosing subsystem has startedStatusHeartBeatpublication- Specified by:
preStartin interfaceServiceLifecycle
-
getMessagingAccess
ReturnsAgentMessagingLayerused by thisAgent. The returned instance is used by theAgentinternally, and can also be used by the client code to publish messages on the buses.- Returns:
AgentMessagingLayerused by thisAgent
-
isConnectedToTheBuses
public boolean isConnectedToTheBuses()Returnstrueonce the Agent has been connected to the buses.- Returns:
- True if the Agent has been connected to the buses.
-
onEvent
- Specified by:
onEventin interfaceDispatcher.Listener
-