stella.parameter
Class SwitchSkeleton
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractRemoteParameter
stella.parameter.AbstractRemoteTrigger
stella.parameter.AbstractRemoteSwitch
stella.parameter.SwitchSkeleton
- All Implemented Interfaces:
- Cloneable, Remote, Parameter, ParameterDepending, RemoteParameter, RemoteSwitch, RemoteTrigger, Switch, Trigger, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying, RmiCaster
public class SwitchSkeleton
- extends AbstractRemoteSwitch
- implements ParameterDepending, Reloadable
A trigger that takes a non-remote trigger and exports it to the
registry. Intended for triggers that are only to a limited extend used
as remote.
| Methods inherited from class stella.parameter.AbstractParameter |
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString |
| 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 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 |
KEY_EXPORT
public static final String KEY_EXPORT
- The parameter that should be exported.
- See Also:
- Constant Field Values
export
private transient Switch export
- The parameter that is to be exported.
SwitchSkeleton
public SwitchSkeleton(Map prop)
throws RemoteException
- Constructs a new parameter skeleton. This is the server-side of an
rmi-enabled parameter.
- Throws:
RemoteException
rescanned
public double rescanned(String key,
String old,
String newval)
- We throw an illegal argument exception if export changed
- Specified by:
rescanned in interface Reloadable- Overrides:
rescanned in class AbstractRemoteParameter
registerParameter
public void registerParameter(Parameter what)
- Registers a parameter to this skeleton. If the parameter's name matches
the
KEY_EXPORT property, the parameter is exported via
its #KEY_BINDNAME.
- Specified by:
registerParameter in interface ParameterDepending
get
public Object get()
- Returns the value of the registered parameter.
- Specified by:
get in interface Parameter
set
public Object set(Object to)
- Sets the value of this parameter. Passes the call to the registered
parameter.
- Specified by:
set in interface Parameter
- Returns:
- The previous value of this parameter.
getTrigger
public Boolean getTrigger()
- Returns the same value as
Parameter.get() but already cast into a
boolean.
- Specified by:
getTrigger in interface Trigger
isTrue
public boolean isTrue()
- Returns the value of the trigger as a boolean primitive.
- Specified by:
isTrue in interface Trigger
setTrigger
public Boolean setTrigger(Boolean to)
throws UnsupportedOperationException
- Does the same thing as
Parameter.set(java.lang.Object) but returns the old value
as a boolean.
- Specified by:
setTrigger in interface Trigger
- Throws:
UnsupportedOperationException
toggleTrigger
public Boolean toggleTrigger()
throws UnsupportedOperationException
- Toggles the value of this trigger. This method does not have a
Parameter counterpart. The return value is the old value
of the trigger.
- Specified by:
toggleTrigger in interface Trigger
- Throws:
UnsupportedOperationException
getLastToggleTime
public Date getLastToggleTime()
- Returns the date of the last toggle event on this trigger.
- Specified by:
getLastToggleTime in interface Trigger
getElapsedToggleTime
public long getElapsedToggleTime()
- Returns the elapsed time from the last toggle event on the trigger
until now. The returned time is a time in ms, passed over as a long.
- Specified by:
getElapsedToggleTime in interface Trigger
turnOn
public boolean turnOn(long timeout)
- Switches the local switch.
- Specified by:
turnOn in interface Switch
- Parameters:
timeout - The maximum time the switch should be on (ms), zero for
unlimited.
- Returns:
- True, if switch was successfully turned on.
turnOff
public boolean turnOff()
- Switches the local switch.
- Specified by:
turnOff in interface Switch
- Returns:
- True, if switch was successfully turned off.