
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 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 |
|---|---|
TreeBranch<String> |
getComponentTree()
publishes a tree of subcomponents' names.
|
Configurable.Environment |
getEnvironment() |
String |
getName() |
int |
getNObserverThreads() |
List<Observable> |
getObservables() |
Subsystem |
getSubsystem() |
int |
getTickMillis() |
void |
init()
This method is called from the enclosing subsystem constructor.
|
void |
initModule()
To be overriden by individual modules.
|
void |
listens(Observable... observs) |
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 |
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 |
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 |
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()
Deprecated.
Does this really have to be public?
|
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, dropSubmittedChanges, getCheckedValueFromConfiguration, getChildren, getComponentByName, getParent, getParentObject, getSubmittedChanges, isParameterConfigurable, notifyChange, notifyChangeWithoutPreliminaryChecks, printConfigurableParameters, setBulkParameter, start, submitChange, submitChanges, validateBulkChangeprotected Configurable.Environment environment
protected String name
protected int nObserverThreads
@ConfigurationParameter protected int tickMillis
public Module()
public Module(int tickMillis)
public Module(String name, int tickMillis)
public Module(String name)
public String getName()
getName in interface Configurablepublic void setName(String name)
name - 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()
@ConfigurationParameterChanger(propertyName="tickMillis") 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()
public Subsystem getSubsystem()
getSubsystem in interface Configurablepublic void postStart()
throws HardwareException
ConfigurablepostStart in interface ConfigurableHardwareException@Deprecated public 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()
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=SIGNAL) public void sendSignal(String signalString)
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=SIGNAL) public void sendSignalWithTimeLimit(String signalString, long expectedMaxDelay)
signalString - string representing a member of an enum of type
SignalLevelexpectedMaxDelay - @Command(description="publishes a tree of component names", type=QUERY, category=SYSTEM) public TreeBranch<String> getComponentTree()
Copyright © 2016 LSST. All rights reserved.