|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.sensor.ReadoutRepository
public class ReadoutRepository
This class acts as a repository for a whole bundle of sensor values. On
initialisation it tries to register to all the sensors given with either
the KEY_LIST or the KEY_FILE keys as a
RmiDataListener. Incoming DataEvents from these sensors
are buffered and can be retrieved with the getActualData(java.lang.String) method.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static int |
COUNT
An internal counter for automatic naming. |
private static boolean |
DEFBIND
The default auto-binding. |
private static String |
DEFBINDNAME
The default binding name. |
private static String |
DEFURLRESOURCES
The resources to scout. |
static String |
KEY_BIND
The key in the Map referring to auto-binding of the sensor. |
static String |
KEY_BINDNAME
The key in the Map referring to the bind name of the sensor. |
static String |
KEY_FILE
The key linked to the sensor names. |
static String |
KEY_LIST
The key linked to the sensor names. |
private HashMap |
lookup
The look-up table matching sensor names to actual data events. |
| Fields inherited from class util.rmi.AbstractRmiListener |
|---|
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY |
| 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.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
ReadoutRepository(Map prop)
Constructs a new readout-repository. |
|
| Method Summary | |
|---|---|
boolean |
bindToRegistry()
Binds this repository's casting capabilities to a running registry. |
protected boolean |
deregisterAtCaster(RmiCaster rmi,
Class single)
Registers at the given caster. |
void |
exit()
Exits the read-out repository. |
DataEvent |
getActualData(String name)
Returns the last data event received from the sensor with the given name. |
void |
init()
Initializes the read-out repository. |
private static int |
nextCount()
Gets the next available number at automatic naming. |
protected boolean |
registerAtCaster(RmiCaster rmi,
Class single)
Registers at the given caster. |
void |
registerSensors()
Initalizes the repository sensors. |
void |
rmiAddParameter(URL info)
Throws an unsupported operation exception-sensors are read-only. |
void |
rmiDataAvailable(DataEvent de)
Receives an incoming DataEvent. |
Object |
rmiGet(String name)
Returns the actual value of the stated sensor. |
Set |
rmiGetAllParameterNames()
Returns the names of all sensors observed by this repository as a set. |
void |
rmiRemoveParameter(String info)
Throws an unsupported operation exception-sensors are read-only. |
Object |
rmiSet(String name,
Object to)
Throws an unsupported operation exception-sensors are read-only. |
boolean |
unbindFromRegistry()
Unbinds this repository from the registry. |
| Methods inherited from class util.rmi.AbstractRmiListener |
|---|
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding |
| Methods inherited from class util.rmi.RmiPropertyContainer |
|---|
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty |
| 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, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.rmi.RmiEventListener |
|---|
getListenerName |
| Methods inherited from interface util.rmi.RmiListener |
|---|
disconnect, isConnected |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| 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 |
| Field Detail |
|---|
public static final String KEY_LIST
public static final String KEY_FILE
public static final String KEY_BIND
public static final String KEY_BINDNAME
private static final boolean DEFBIND
private static final String DEFBINDNAME
private static final String DEFURLRESOURCES
private HashMap lookup
private static int COUNT
| Constructor Detail |
|---|
public ReadoutRepository(Map prop)
throws RemoteException
KEY_LIST or the KEY_FILE keys
are given. registerSensors() method must
be called.
RemoteException| Method Detail |
|---|
private static int nextCount()
public void init()
KEY_BIND key.
init in interface Initializableinit in class PropertyResourcespublic void exit()
KEY_BIND key.
exit in interface ExitCleaningexit in class AbstractRmiListener
public boolean bindToRegistry()
throws RemoteException
RemoteException
public boolean unbindFromRegistry()
throws RemoteException
RemoteExceptionpublic void registerSensors()
RmiDataCaster reference. The repository
then registers at this caster as a listener. Note that construction
of the lookup-table is done in this method, but the mapping is
constructed as the first data-event from the specific source is
received.
registerAtCaster(util.rmi.RmiCaster, java.lang.Class)
public void rmiDataAvailable(DataEvent de)
throws RemoteException
DataEvent. This data event is stored in
the lookup-table, using its RmiEvent.getSourceName() method
as a key.
rmiDataAvailable in interface RmiDataListenerRemoteExceptionpublic DataEvent getActualData(String name)
public Object rmiGet(String name)
throws RemoteException
RawDataEvent.getPhysical(), the sensor's raw data,
as returned
by the RawDataEvent.getRaw() method is returned.
rmiGet in interface RmiParameterClusteringRemoteException
public Object rmiSet(String name,
Object to)
throws RemoteException
rmiSet in interface RmiParameterClusteringRemoteException
public void rmiAddParameter(URL info)
throws RemoteException
rmiAddParameter in interface RmiParameterClusteringRemoteException
public void rmiRemoveParameter(String info)
throws RemoteException
rmiRemoveParameter in interface RmiParameterClusteringRemoteException
public Set rmiGetAllParameterNames()
throws RemoteException
rmiGetAllParameterNames in interface RmiParameterClusteringRemoteException
protected boolean registerAtCaster(RmiCaster rmi,
Class single)
RmiDataCaster, the repository registers at it.
registerAtCaster in class AbstractRmiListener
protected boolean deregisterAtCaster(RmiCaster rmi,
Class single)
RmiDataCaster, the repository registers at it.
deregisterAtCaster in class AbstractRmiListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||