|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractTrigger
stella.parameter.SimpleTrigger
stella.parameter.DeviceTrigger
public class DeviceTrigger
Device trigger are used to mirror the status of an external command server.
They are true if communication to the devices is possible. Device triggers
are the only triggers that have a run method which periodically checks
the connection. To allow starting of the trigger the command launcher
must be registered to this trigger prior to launching the thread with
registerCommandLaunching(stella.CommandLaunching).
Due to this special behaviour the construction of a device trigger with the
AbstractParameter.createParameter(java.util.Map) method is not advised.
| Nested Class Summary | |
|---|---|
private class |
DeviceTrigger.PingTask
The timer task that connects to the device. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static long |
DEFPING
The default value of the is-alive intervall, in ms (10000). |
private CommandLaunching |
device
The reference to the underlying command server. |
private List |
errlist
The vector of error listeners. |
static String |
KEY_PING
The key linked to the is-alive intervall. |
static String |
NAME_EXT
The default extension to the trigger's server name. |
private TimerTask |
ping
The timer task of the trigger that does the actual ping. |
| Fields inherited from class stella.parameter.SimpleTrigger |
|---|
KEY_INITBOOLEAN |
| 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 | |
|---|---|
DeviceTrigger(Map prop)
Constructs a new sequence trigger with the given name and default value. |
|
| Method Summary | |
|---|---|
void |
addErrorListener(ErrorListener ear)
Registers an error event listener to this sequencer. |
void |
exit()
Cancels the pinger task on exit. |
long |
getPingPeriod()
Returns the onig period of this device trigger. |
TimerTask |
getTimerTask()
Return the timer task associated with this device trigger.Note that starting the device trigger via an timer objects lies within the responsiblity of the calling object. |
protected void |
notifyErrorListener(ErrorEvent ee)
Notifies all registered ErrorListeners. |
void |
registerCommandLaunching(CommandLaunching server)
Registers a command launching instance to this device trigger. |
void |
removeErrorListener(ErrorListener ear)
Deregisters an error event listener from this sequencer. |
Boolean |
setTrigger(Boolean val)
Sets the value of this trigger. |
Boolean |
toggleTrigger()
Toggling the trigger is not allowed, set is only through timer task. |
| Methods inherited from class stella.parameter.SimpleTrigger |
|---|
getLastToggleTime, getTrigger, init, rescanned |
| Methods inherited from class stella.parameter.AbstractTrigger |
|---|
get, getElapsedToggleTime, isTrue, set |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, 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, getString |
| 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 |
|---|
public static final String NAME_EXT
public static final String KEY_PING
private static final long DEFPING
private CommandLaunching device
private List errlist
private TimerTask ping
| Constructor Detail |
|---|
public DeviceTrigger(Map prop)
KEY_PING points to
a parsable long.
| Method Detail |
|---|
public void exit()
exit in interface ExitCleaningexit in class AbstractParameterpublic void registerCommandLaunching(CommandLaunching server)
The default start value of the trigger is retrieved from the server. Note that this are special triggers that are always constructed in a trigger set, but should never be specialized in the trigger set trigger's list!
public long getPingPeriod()
getTimerTask() method. Note that
starting the device trigger via an timer objects lies within the
responsiblity of the calling object.
public TimerTask getTimerTask()
public Boolean setTrigger(Boolean val)
setTrigger in interface TriggersetTrigger in class SimpleTriggerpublic Boolean toggleTrigger()
toggleTrigger in interface TriggertoggleTrigger in class AbstractTriggerpublic void addErrorListener(ErrorListener ear)
addErrorListener in interface ErrorCasterpublic void removeErrorListener(ErrorListener ear)
removeErrorListener in interface ErrorCasterprotected void notifyErrorListener(ErrorEvent ee)
An error event signaling a lost connection is only generated if the connection state changes from connected to not connected, not if a server is simply not connected.
ee - The ErrorEvent to pass to the Listeners.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||