
public class Module extends Observable implements HasLifecycle, ConfigurationBulkChangeHandler, 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 String |
name
Deprecated.
the name of this component can be accessed via
getName()
Use your own field if you wish to assign it. |
protected int |
nObserverThreads |
protected int |
tickMillis |
| Constructor and Description |
|---|
Module() |
Module(int tickMillis) |
Module(String name)
Deprecated.
the name can be accessed via
getName() |
Module(String name,
int tickMillis)
Deprecated.
the name can be accessed via
getName() |
| Modifier and Type | Method and Description |
|---|---|
int |
getNObserverThreads()
Deprecated.
it does not provide any useful information
|
List<Observable> |
getObservables()
Returns the list of Observable this module is observing.
|
int |
getTickMillis() |
void |
init()
Called from the enclosing
Subsystem at
initialization phase. |
void |
initModule()
To be overriden by individual modules.
|
void |
listens(Observable... observs)
Adds a list of observables for this module.
|
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 |
setNObserverThreads(int observerThreads)
Deprecated.
|
void |
setObservables(List<Observable> l)
Adds a list of observables for this module.
|
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, dropSubmittedChanges, getChildren, getComponentByName, getEnvironment, getParent, getParentObject, getSubmittedChanges, isParameterConfigurable, printConfigurableParameters, setBulkParameter, submitChange, submitChanges, validateBulkChangesetParameterBulkpostStart, startgetComponentConfigurationEnvironment, getComponentLookup, getName, getSubsystem@Deprecated protected String name
getName()
Use your own field if you wish to assign it.protected int nObserverThreads
@ConfigurationParameter protected int tickMillis
public Module()
public Module(int tickMillis)
@Deprecated public Module(String name, int tickMillis)
getName()name - tickMillis - @Deprecated public Module(String name)
getName()name - public void setObservables(List<Observable> l)
l - the list of Observable to addpublic void listens(Observable... observs)
observs - one or more Observable to addpublic 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()
@Deprecated public void setNObserverThreads(int observerThreads)
observerThreads - @Deprecated public int getNObserverThreads()
public final void init()
HasLifecycleSubsystem at
initialization phase. 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
MessageListener objects.
It is unnecessary to call super.init()
init in interface HasLifecyclepublic void initModule()
public final 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 HasLifecyclepublic 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 - Copyright © 2016 LSST. All rights reserved.