
public class Module extends Observable implements Observer, Configurable, SignalHandler
notes: module driver, sends to functionnal modules such as calibration iquestion: how are the module sindependants have a look at sampler ....
| Modifier and Type | Class and Description |
|---|---|
class |
Module.ValueUpdate |
Configurable.Environment| Modifier and Type | Field and Description |
|---|---|
protected Configurable.Environment |
environment |
protected static Logger |
log |
protected String |
name |
protected int |
nObserverThreads |
protected int |
tickMillis |
| Constructor and Description |
|---|
Module() |
Module(int tickMillis) |
Module(String name) |
Module(String name,
int tickMillis) |
| Modifier and Type | Method and Description |
|---|---|
void |
alias(String alias)
runtime alias for invoking commands.
|
TreeBranch<DictionaryContext> |
getComponentDictionariesTree()
publishes a tree where each node associates a component's name with its dictionary
|
TreeBranch<String> |
getComponentTree()
publishes a tree of subcomponents' names
|
Context |
getContext()
Deprecated.
|
Configurable.Environment |
getEnvironment() |
Dictionary |
getMainDictionary()
published the topmost command dictionary : this is a composite command dictionary
that references the main dictionary and the subsystem dictionary.
|
Module |
getModule(String moduleName)
Finds a module by name within the same ModularSubsystem
|
String |
getName()
get the name of this component
|
int |
getNObserverThreads() |
List<Observable> |
getObservables() |
Subsystem |
getSubsystem() |
int |
getTickMillis() |
void |
init()
this method is called as a "postStart" operation.
|
void |
initModule()
To be overriden by individual modules.
|
void |
listens(Observable... observs) |
void |
percolateSignal(Signal signal)
utility method to send a signal to all branches of a component's tree
|
void |
postStart()
once all hardware components have been started this method is invoked.
|
void |
processUpdate(Observable source,
Module.ValueUpdate update)
This method should be overriden to handle change to properties of
watched modules
|
void |
publishData(DataValueNotification td)
Deprecated.
|
void |
publishData(List<ValueNotification> tdl)
Deprecated.
|
void |
publishData(String name,
Object value)
Deprecated.
|
void |
publishData(String name,
Object value,
long tStamp)
Deprecated.
|
void |
publishData(String name,
Serializable value)
Deprecated.
|
void |
publishData(String name,
Serializable value,
long tStamp)
Deprecated.
|
void |
publishData(ValueNotification td)
Deprecated.
|
void |
sendSignal(long expectedMaxDelay,
String signalString)
Deprecated.
|
void |
sendSignal(String signalString)
command to send a signal.
|
void |
sendSignalWithTimeLimit(String signalString,
long expectedMaxDelay)
command to send a signal with a delay for execution.
|
void |
sendToReply(CommandReply myReply)
Deprecated.
|
void |
sendToStatus(Status status)
Deprecated.
|
void |
setBeanName(String n)
Deprecated.
|
void |
setContext(Context context)
Deprecated.
|
void |
setEnvironment(Configurable.Environment environment)
sets the current Environment Object for the Component.
|
void |
setName(String name)
Sets the module name.
|
void |
setNObserverThreads(int observerThreads) |
void |
setObservables(List<Observable> l) |
void |
setStateModularSubsystem(PublishedState newState)
Deprecated.
|
void |
setStateModularSubsystem(PublishedState newState,
String extraInfo)
Deprecated.
|
void |
setTickMillis(int tickMillis)
Changes the periodic wake up time.
|
void |
shutdownNow()
added for tying to unstuck ExcecutorService
|
TreeWalkerDiag |
signal(Signal sig)
this method is intended for overriding:
the module receives an out of band signal.
|
void |
startTicking()
If there is a scheduled wake up (that is if the tickMillis is more
than zero) then the ticking starts.
|
void |
tick() |
void |
update(Observable o,
Object arg)
Synchronous update.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchange, getCheckedValueFromConfiguration, getChildren, getComponentByName, getDictionary, getParent, getParentObject, injectResources, listChildren, notifyChange, notifyChangeWithoutPreliminaryChecks, proceduralWalk, publish, publish, publish, publish, publish, publish, start, treeWalkprotected Configurable.Environment environment
protected static Logger log
protected String name
protected int nObserverThreads
protected int tickMillis
public Module()
public Module(int tickMillis)
public Module(String name, int tickMillis)
public Module(String name)
public String getName()
ConfigurablegetName in interface Configurablepublic void setName(String name)
name - public void alias(String alias)
alias in interface Configurablealias - public Configurable.Environment getEnvironment()
getEnvironment in interface Configurablepublic void setEnvironment(Configurable.Environment environment)
ConfigurablesetEnvironment in interface Configurablepublic void setObservables(List<Observable> l)
public void listens(Observable... observs)
public List<Observable> getObservables()
@ConfigChanger(argNames="tickInterval") public void setTickMillis(int tickMillis)
if called before startup this method just fix the tick frequency (the module wil later "tick" at this rate) .
if called after startup then will change the ticking rate
in that case the ticking will change but new rate will be effective
after a delay of "old rate"
tickMillis - public int getTickMillis()
public void setNObserverThreads(int observerThreads)
public int getNObserverThreads()
public final void init()
Configurableinit in interface Configurablepublic void initModule()
@Deprecated public Context getContext()
@Deprecated public void setContext(Context context)
public Subsystem getSubsystem()
getSubsystem in interface Configurablepublic Module getModule(String moduleName)
moduleName - public void postStart()
throws HardwareException
ConfigurablepostStart in interface ConfigurableHardwareExceptionpublic void startTicking()
public void update(Observable o, Object arg)
public void processUpdate(Observable source, Module.ValueUpdate update)
source - the moduleupdate - the update message, containing property name and new
valuepublic void tick()
@Deprecated public void setBeanName(String n)
@Deprecated public void setStateModularSubsystem(PublishedState newState)
newState - The new state of the modular subsystem@Deprecated public void setStateModularSubsystem(PublishedState newState, String extraInfo)
newState - The new state of the modular subsystemextraInfo - Can clarify a state, like origin of the error@Deprecated public void publishData(String name, Object value, long tStamp)
@Deprecated public void publishData(String name, Serializable value, long tStamp)
@Deprecated public void publishData(String name, Object value)
@Deprecated public void publishData(String name, Serializable value)
@Deprecated public void publishData(List<ValueNotification> tdl)
@Deprecated public void publishData(ValueNotification td)
@Deprecated public void publishData(DataValueNotification td)
@Deprecated public void sendToStatus(Status status)
@Deprecated public void sendToReply(CommandReply myReply)
myReply - : reply objet MODULES SHOULD NOT DO THAT....public void shutdownNow()
shutdownNow in interface Configurablepublic TreeWalkerDiag signal(Signal sig)
signal in interface SignalHandlersig - @Command(description="will propagate signal to Module and its children ", type=ABORT) public void sendSignal(String signalString)
signalString - string representing a member of an enum of type SignalLevel@Command(description="@Deprecated: will propagate signal to Module and its children with an expected maximum delay", type=ABORT) @Deprecated public void sendSignal(long expectedMaxDelay, String signalString)
expectedMaxDelay - signalString - string representing a member of an enum of type SignalLevel@Command(description="will propagate signal to Module and its children with an expected maximum delay", type=ABORT) public void sendSignalWithTimeLimit(String signalString, long expectedMaxDelay)
signalString - string representing a member of an enum of type SignalLevelexpectedMaxDelay - public void percolateSignal(Signal signal)
signal - @Command(description="publishes a tree of component names", type=QUERY, category=SYSTEM) public TreeBranch<String> getComponentTree()
@Command(description="publishes the topmost command dictionary", type=QUERY, category=SYSTEM) public Dictionary getMainDictionary()
IllegalArgumentException - if the current Module is not the main@Command(description="publishes a tree of component dictionary", type=QUERY, category=SYSTEM) public TreeBranch<DictionaryContext> getComponentDictionariesTree()
Copyright © 2015 LSST. All rights reserved.