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 Details

    • MessagingService

      public MessagingService()
  • Method Details

    • getAgentServiceName

      public String getAgentServiceName()
      Description copied from interface: AgentService
      Get the name of this service. This name will be used to add the given service to the lookup tree.
      Specified by:
      getAgentServiceName in interface AgentService
      Returns:
      the AgentService name.
    • startForAgent

      public boolean startForAgent(AgentInfo agentInfo)
      Description copied from interface: AgentService
      This method is invoked after an agent service is created to see if this service is to be started for the tiven Agent.
      Specified by:
      startForAgent in interface AgentService
      Returns:
      true if the service is to be added to the given agent.
    • preBuild

      public void preBuild()
      Specified by:
      preBuild in interface ServiceLifecycle
    • afterBuild

      public void afterBuild()
      Specified by:
      afterBuild in interface ServiceLifecycle
    • preStart

      public void preStart()
      Description copied from interface: ServiceLifecycle
      Called from the enclosing Subsystem 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 :

      • the PhaseState is INITIALIZING
      • connection with the messaging layer is effective, the enclosing subsystem has started StatusHeartBeat publication
      Specified by:
      preStart in interface ServiceLifecycle
    • getMessagingAccess

      public AgentMessagingLayer getMessagingAccess()
      Returns AgentMessagingLayer used by this Agent. The returned instance is used by the Agent internally, and can also be used by the client code to publish messages on the buses.
      Returns:
      AgentMessagingLayer used by this Agent
    • isConnectedToTheBuses

      public boolean isConnectedToTheBuses()
      Returns true once the Agent has been connected to the buses.
      Returns:
      True if the Agent has been connected to the buses.
    • onEvent

      public void onEvent(Dispatcher.Event event)
      Specified by:
      onEvent in interface Dispatcher.Listener