Class RuntimeService

java.lang.Object
org.lsst.ccs.services.RuntimeService
All Implemented Interfaces:
HasLifecycle, ServiceLifecycle, AgentMonitor, AgentService

public final class RuntimeService extends Object implements ServiceLifecycle, HasLifecycle, AgentMonitor, AgentService
A Service to provide jmx access to the Agetn's runtime. It also monitors possible dead-locks.
Author:
The LSST CCS Team
  • Constructor Details

    • RuntimeService

      public RuntimeService()
  • 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.
    • build

      public void build()
      Description copied from interface: HasLifecycle
      First lifecycle hook. Modification of the component tree is allowed at this stage. After this stage the tree of component cannot be modified anymore. This is where agent periodic tasks should be scheduled.
      Specified by:
      build in interface HasLifecycle
    • init

      public void init()
      Description copied from interface: HasLifecycle
      Called from the enclosing Subsystem at initialization phase.

      This method is called before the children components of this object have their init method called.

      At the time it is called, connection to the messaging layer is not yet done, so there should be no attempt to send messages in the body of this method. Configuration for message listening can nevertheless be done here, such as adding MessageListener objects.

      It is unnecessary to call super.init()

      Specified by:
      init in interface HasLifecycle
    • getAgentMonitorStatus

      public String getAgentMonitorStatus(boolean useCcsBuses)
      Description copied from interface: AgentMonitor
      This method should return the string "OK" if everything is working as expected. Otherwise it should return a message explaining the problem. This method is meant to be invoked from two places: - by a JMX environment - by a periodic task within the Agent It should be quick at evaluating the Agent status. In an attempt to de-couple the status of an Agent from the status of the buses, when this method is invoked from JMX there should be no attempt at using the CCS buses. The provided boolean parameter tells if the method is being invoked form jmx or from the periodic task. Specific implementations should make sure that access to this method is synchronized.
      Specified by:
      getAgentMonitorStatus in interface AgentMonitor
      Parameters:
      useCcsBuses - a boolean to tell if the CCS buses should be used: for example to raise an Alert. This is true when the method is invoked from the periodic task. If it's invoked form JMX its value is false.
      Returns:
      The Status of the AgentMonitor.
    • getAgentMonitorDescription

      public String getAgentMonitorDescription()
      Description copied from interface: AgentMonitor
      Get the description for this AgentMonitor. This will be used when logging check information.
      Specified by:
      getAgentMonitorDescription in interface AgentMonitor
      Returns:
      The description for this AgentMonitor.