public abstract class AbstractWeatherSurveyor extends AbstractRmiCaster implements WeatherSurveying
WeatherSurveying interface.
This
class extends CastingContainer to implement the
stella.rmi.RmiPropertyBearing interface and provides a
single-argument
constructor, with a Map object as the argument.
Normally, concrete implementations of this class will also implement the
RmiWeatherReporting interface.
To make construction out of a properties file more convenient,
a static createWeatherSurveyor(java.util.Map) method is given.
For convenience, the method required by the weather caster are already
implemented. Subclasses may use the notifyWeatherListener(stella.sensor.WeatherEvent) method
for passing a weather event to the listeners.
PropertyResources.Load, PropertyResources.URLResourceWeatherSurveying.DataBlock| Modifier and Type | Field and Description |
|---|---|
private List |
list
The registered listeners.
|
ALTERNATEHOST, ALTERNATEPORT, KEY_BINDNAME, KEY_EXPORTPORT, KEY_REGISTRYHOST, KEY_REGISTRYPORTKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWeatherSurveyor(Map prop)
Constructs a new weather watching instance with the specified
properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addWeatherListener(WeatherListener add)
Adds a weather listener to this weather surveyer.
|
static WeatherSurveying |
createWeatherSurveyor(Map prop)
Constructs a new weather watching instance using the mapping of the
PropertySupplying.KEY_CLASS to the class name to derive the class to instantiate. |
protected void |
notifyWeatherListener(WeatherEvent we)
Notifies all registered WeatherListeners.
|
void |
removeWeatherListener(WeatherListener remove)
Removes a weather listener from this weather surveyor.
|
String |
status()
Basic implementeation of the status method.
|
bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, bindToRegistry, casterExit, casterExit, exit, getBindName, getBindName, isValid, unbindFromRegistry, unbindFromRegistrycontainsRemoteProperty, 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, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAllSensors, getCurrentlyRetarding, getCurrentWeather, getSensor, registerSensorDriver, startSensorsconciseStatus, extendedStatusregisterGlobalsdefaultBoolean, 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, stringPropertiesinitgetElapsedToggleTime, getLastToggleTime, getTrigger, isTrue, setTrigger, toggleTriggerprivate List list
protected AbstractWeatherSurveyor(Map prop)
PropertySupplying.KEY_CLASS is always mapped when this
constructer is used.public static final WeatherSurveying createWeatherSurveyor(Map prop)
PropertySupplying.KEY_CLASS to the class name to derive the class to instantiate.
If this property is defined, a new WeatherSurveying
instance with the stated
class name is created, the supplied properties used as an argument in
the constructor. Can throw a lot of exceptions if unsuccessful.public void addWeatherListener(WeatherListener add)
addWeatherListener in interface WeatherCasterpublic void removeWeatherListener(WeatherListener remove)
removeWeatherListener in interface WeatherCasterprotected void notifyWeatherListener(WeatherEvent we)
we - The WeatherEvent to pass to the Listeners.public String status()
PropertyContainer.toString() value. Subclasses should override this basic
behaviour.