Package org.lsst.ccs.services
Class DataProviderDictionaryService
java.lang.Object
org.lsst.ccs.services.DataProviderDictionaryService
- All Implemented Interfaces:
HasLifecycle,BusMessagePreProcessor,ServiceLifecycle,AgentService
public final class DataProviderDictionaryService
extends Object
implements ServiceLifecycle, HasLifecycle, AgentService, BusMessagePreProcessor
A service to manage a worker subsystem's dictionary of DataProviders.
- Author:
- The LSST CCS Team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic classAn event fired toDataProviderDictionaryListeners when an agent data dictionary has changed.static interfaceA Listener to receive notifications of DataProviderDictionary changes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataProviderDictionaryListener(DataProviderDictionaryService.DataProviderDictionaryListener listener) voidvoidaddMetadataForObject(KeyValueDataList data, String metadataName, String metadataValue, Object origin) voidintintGet the name of this service.getBus()The Bus this BusMessagePreProcessor applies to.getDataProviderDictionaryForAgent(String agentName) longvoidinit()Called from the enclosingSubsystemat initialization phase.voidpreBuild()Pre-process the incoming BusMessage and return the message to be forwarded to the bus message listeners.voidvoidpurge()Deprecated.voidDeprecated.voidregisterClass(Class clazz) voidregisterClass(Class clazz, String path) voidregisterData(KeyValueData kvd) voidregisterData(KeyValueData kvd, boolean isPeriodic) voidremoveDataProviderDictionaryListener(DataProviderDictionaryService.DataProviderDictionaryListener listener) voidshutdown()Called from the enclosingSubsystemwhenorg.lsst.ccs.Subsystem#shutdown()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.final DataProviderDictionarywaitForAgentDictionary(AgentInfo agentInfo, long timeout, TimeUnit unit) 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
build, postBuild, postInit, postShutdown, postStart, startMethods inherited from interface org.lsst.ccs.ServiceLifecycle
afterBuild, afterStart, preInit, preShutdown, preStart
-
Constructor Details
-
DataProviderDictionaryService
public DataProviderDictionaryService()
-
-
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
-
afterInit
public void afterInit()- Specified by:
afterInitin interfaceServiceLifecycle
-
getDictionaryChecksum
public long getDictionaryChecksum() -
shutdown
public void shutdown()Description copied from interface:HasLifecycleCalled from the enclosingSubsystemwhenorg.lsst.ccs.Subsystem#shutdown()has been called. At the time it is calledPhaseStateisCLOSING. It should be overridden to free non hardware related resources.- Specified by:
shutdownin interfaceHasLifecycle
-
addDataProviderInfoToDictionary
-
getDataProviderDictionary
-
getDataProviderDictionaryForAgent
-
addMetadataForObject
public void addMetadataForObject(KeyValueDataList data, String metadataName, String metadataValue, Object origin) -
purge
Deprecated. -
purge
Deprecated. -
registerData
-
registerData
-
registerClass
-
registerClass
-
publishingTrendingData
-
calculateHashCodeForData
-
calculateHashCodeForData
-
addDataProviderDictionaryListener
public void addDataProviderDictionaryListener(DataProviderDictionaryService.DataProviderDictionaryListener listener) -
removeDataProviderDictionaryListener
public void removeDataProviderDictionaryListener(DataProviderDictionaryService.DataProviderDictionaryListener listener) -
getBus
Description copied from interface:BusMessagePreProcessorThe Bus this BusMessagePreProcessor applies to.- Specified by:
getBusin interfaceBusMessagePreProcessor- Returns:
- The Bus.
-
preProcessMessage
Description copied from interface:BusMessagePreProcessorPre-process the incoming BusMessage and return the message to be forwarded to the bus message listeners. The returned message can either be a modified version of the original message or a brand new message. The Class of the returned message can be different than the incoming message. If null is returned the message will not be sent to the BusMessage listeners, but it will still be passed to other BusMessagePreProcessors This method can be invoked by separate threads, but it's invoked by one thread at a time; there is no concurrent invocation of the method.- Specified by:
preProcessMessagein interfaceBusMessagePreProcessor- Parameters:
msg- The incoming BusMessage- Returns:
- The modified BusMessage to be forwarded to the BusMessageListeners
-
waitForAgentDictionary
public final DataProviderDictionary waitForAgentDictionary(AgentInfo agentInfo, long timeout, TimeUnit unit) throws InterruptedException - Throws:
InterruptedException
-