public class ReadoutRepository extends AbstractRmiListener implements RmiParameterClustering, RmiDataListener, Initializable
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.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
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.
|
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAYKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Constructor and Description |
|---|
ReadoutRepository(Map<String,String> prop)
Constructs a new readout-repository.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBindingcontainsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemotePropertyclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetListenerNamedisconnect, isConnecteddefaultBoolean, 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, stringPropertiespublic 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
public ReadoutRepository(Map<String,String> prop) throws RemoteException
KEY_LIST or the KEY_FILE keys
are given. registerSensors() method must
be called.RemoteExceptionprivate static int nextCount()
public void init()
KEY_BIND key.init in interface Initializablepublic void exit()
KEY_BIND key.exit in interface ExitCleaningexit in class AbstractRmiListenerpublic boolean bindToRegistry()
throws RemoteException
RemoteExceptionpublic 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.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 RmiParameterClusteringRemoteExceptionpublic Object rmiSet(String name, Object to) throws RemoteException
rmiSet in interface RmiParameterClusteringRemoteExceptionpublic void rmiAddParameter(URL info) throws RemoteException
rmiAddParameter in interface RmiParameterClusteringRemoteExceptionpublic void rmiRemoveParameter(String info) throws RemoteException
rmiRemoveParameter in interface RmiParameterClusteringRemoteExceptionpublic Set rmiGetAllParameterNames() throws RemoteException
rmiGetAllParameterNames in interface RmiParameterClusteringRemoteExceptionprotected boolean registerAtCaster(RmiCaster rmi, Class single)
RmiDataCaster, the repository registers at it.registerAtCaster in class AbstractRmiListenerprotected boolean deregisterAtCaster(RmiCaster rmi, Class single)
RmiDataCaster, the repository registers at it.deregisterAtCaster in class AbstractRmiListener