Package org.lsst.ccs.services
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
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild()First lifecycle hook.Get the description for this AgentMonitor.getAgentMonitorStatus(boolean useCcsBuses) This method should return the string "OK" if everything is working as expected.Get the name of this service.voidinit()Called from the enclosingSubsystemat initialization phase.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.framework.HasLifecycle
postBuild, postInit, postShutdown, postStart, shutdown, startMethods inherited from interface org.lsst.ccs.ServiceLifecycle
afterBuild, afterInit, afterStart, preBuild, preInit, preShutdown, preStart
-
Constructor Details
-
RuntimeService
public RuntimeService()
-
-
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.
-
build
public void build()Description copied from interface:HasLifecycleFirst 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:
buildin interfaceHasLifecycle
-
init
public void init()Description copied from interface:HasLifecycleCalled from the enclosingSubsystemat initialization phase.This method is called before the children components of this object have their
initmethod 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
MessageListenerobjects.It is unnecessary to call
super.init()- Specified by:
initin interfaceHasLifecycle
-
getAgentMonitorStatus
Description copied from interface:AgentMonitorThis 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:
getAgentMonitorStatusin interfaceAgentMonitor- 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
Description copied from interface:AgentMonitorGet the description for this AgentMonitor. This will be used when logging check information.- Specified by:
getAgentMonitorDescriptionin interfaceAgentMonitor- Returns:
- The description for this AgentMonitor.
-