Package org.lsst.ccs.services
Class AgentVersionsService
java.lang.Object
org.lsst.ccs.services.AgentVersionsService
- All Implemented Interfaces:
HasLifecycle,AgentPresenceListener,ServiceLifecycle,AgentService
public class AgentVersionsService
extends Object
implements AgentService, ServiceLifecycle, HasLifecycle, AgentPresenceListener
An Agent Service to handle information related to the distribution.
This information includes versions for:
- the current running agent
- the toolkit it's using
- the distribution it's running in
This service also provides a way to verify that the current versions are
supported by the cluster it's running in.
This service is activated for all Agents.
- Author:
- The LSST CCS Team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidInvoked when the state is OPERATIONAL.voidconnecting(AgentInfo... agents) Indicates that the list of agents represented byagentsis present on the buses.voiddisconnected(AgentInfo... agents) Invoked when one or more agents are disconnected from this cluster, either because the shutdown or because they were lost.protected PropertiesextractVersionConstraintPropertiesFor(String key, Properties props) Get the name of this service.voidinit()Called from the enclosingSubsystemat initialization phase.voidpreBuild()voidpreInit()voidbooleanstartForAgent(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.messaging.AgentPresenceListener
connected, disconnectingMethods inherited from interface org.lsst.ccs.framework.HasLifecycle
build, postBuild, postInit, postShutdown, postStart, shutdown, startMethods inherited from interface org.lsst.ccs.ServiceLifecycle
afterBuild, preStart
-
Field Details
-
AGENT
- See Also:
-
TOOLKIT
- See Also:
-
DISTRIBUTION
- See Also:
-
AGENT_VERSION
- See Also:
-
TOOLKIT_VERSION
- See Also:
-
DISTRIBUTION_VERSION
- See Also:
-
-
Constructor Details
-
AgentVersionsService
public AgentVersionsService()
-
-
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
-
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
-
preInit
public void preInit()- Specified by:
preInitin interfaceServiceLifecycle
-
afterInit
public void afterInit()- Specified by:
afterInitin interfaceServiceLifecycle
-
afterStart
public void afterStart()Description copied from interface:ServiceLifecycleInvoked when the state is OPERATIONAL.- Specified by:
afterStartin interfaceServiceLifecycle
-
preShutdown
public void preShutdown()- Specified by:
preShutdownin interfaceServiceLifecycle
-
connecting
Description copied from interface:AgentPresenceListenerIndicates that the list of agents represented byagentsis present on the buses. This method is invoked when the listener is added with all the agents that are already connected. At this point not all services on the connecting agents are guaranteed to have completely started. This method should be used only to receive a notification that an agent is connecting. For a guarantee that an agent information is fully present, please use the#connectedmethods. The implementation should return immediately : any blocking operations should be scheduled on a separate thread.- Specified by:
connectingin interfaceAgentPresenceListener
-
disconnected
Description copied from interface:AgentPresenceListenerInvoked when one or more agents are disconnected from this cluster, either because the shutdown or because they were lost. The implementation should return immediately : any blocking operations should be scheduled on a separate thread.- Specified by:
disconnectedin interfaceAgentPresenceListener
-
extractVersionConstraintPropertiesFor
-
getAllDistributionInfo
-