stella.parameter
Class RemoteSensorStub

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractValue
                      extended by stella.parameter.DataValue
                          extended by stella.parameter.RemoteSensorStub
All Implemented Interfaces:
Cloneable, EventListener, DataListener, Parameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying

public class RemoteSensorStub
extends DataValue
implements Reloadable

This class is a parameter stub, intended to bind to a remotely running sensor. Similar to a ParameterStub, it tries to register at the remote data sensor during initialization.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
static String KEY_REMOTESENSOR
          The key pointing to the machine where the sensors run.
private  MyRmiListener listen
          The rmi-listener & reference watcher for binding to the sensor.
 
Fields inherited from class stella.parameter.DataValue
DERIVATIVE, DERIVATIVEVALUE, KEY_BLOCK, KEY_DATA, PREDICT, PREDICTVALUE, RAW, SMOOTH, SMOOTHVALUE, VALUE
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
RemoteSensorStub(Map info)
          Constructs a new sensor global.
 
Method Summary
 void exit()
          For orderly shutdown, de-register from the binding reference.
 void init()
          Initializes this parameter.
 double rescanned(String key, String old, String newval)
          If the listener reference has changed, we reinit the binding or pass the changed key to the listener properties.
 
Methods inherited from class stella.parameter.DataValue
dataAvailable, getString, getValue, setValue
 
Methods inherited from class stella.parameter.AbstractValue
get, set
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, register, setName, toString
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.Reloadable
reload
 
Methods inherited from interface stella.Parameter
getFormatted, getName
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_REMOTESENSOR

public static final String KEY_REMOTESENSOR
The key pointing to the machine where the sensors run.

See Also:
Constant Field Values

listen

private MyRmiListener listen
The rmi-listener & reference watcher for binding to the sensor.

Constructor Detail

RemoteSensorStub

public RemoteSensorStub(Map info)
Constructs a new sensor global. If the sensor this global should wrap could not be found in the properties, the construction fails with an IllegalArgumentException. Additionally, the properties are scanned for the data source key. If this key is not present or maps to an illegal value, it is (re)mapped to DataValue.VALUE. This guarantees that this key is present and points to a allowed value once the construction phase is finished.

Method Detail

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
If the listener reference has changed, we reinit the binding or pass the changed key to the listener properties.

Specified by:
rescanned in interface Reloadable
Overrides:
rescanned in class AbstractParameter

init

public void init()
Initializes this parameter. This means binding to the remote reference.

Specified by:
init in interface Initializable
Overrides:
init in class AbstractParameter

exit

public void exit()
For orderly shutdown, de-register from the binding reference. Simply call the exit method of the listen helper object.

Specified by:
exit in interface ExitCleaning
Overrides:
exit in class AbstractParameter