stella.parameter
Class AbstractRemoteParameter

java.lang.Object
  extended by util.PropertyContainer
      extended by stella.parameter.AbstractParameter
          extended by stella.parameter.AbstractRemoteParameter
All Implemented Interfaces:
Cloneable, Remote, Parameter, RemoteParameter, ExitCleaning, Initializable, PropertyBearing, RmiCaster
Direct Known Subclasses:
AbstractCCDParameter, AbstractFitsParameter, AbstractRemoteTrigger, AbstractRemoteValue, ExposureCount, ParameterSkeleton, Unique

public abstract class AbstractRemoteParameter
extends AbstractParameter
implements RemoteParameter

A skeleton implementation of a RemoteParameter. This class takes care of proper binding of the parameter to the registry and diverts the remoteGet() method to the Parameter.get() method. Provides also a static method for binding non-subclasses of abstract remote parameter to the registry.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
protected static boolean DEFBIND
          The default auto-binding as a RemoteParameter.
static String KEY_BIND
          The key in the Map for auto-binding of the trigger.
private  List<RmiListener> stubs
          A list of registered rmi listners.
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractRemoteParameter(Map prop)
          Constructs a new remote parameter.
 
Method Summary
 void addRmiListener(RmiListener ear)
          Adds a listener for notification on exit.
 boolean bindToRegistry()
          Binds to registry.
 void exit()
          Unbinds from registry, if bound.
 void init()
          Binds this trigger to the registry.
 boolean isValid()
          Returns true.
 Object remoteGet()
          The remote edge of this trigger.
 void removeRmiListener(RmiListener ear)
          Removes a listener.
protected  double rescanned(String key, String old, String newval)
          If the bind property changed, we deregister from our current binding and re-instantiate a new binding thread.
 boolean unbindFromRegistry()
          Unbinds from registry.
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, isNew, keyCreate, keyCreate, parseObject, reload, 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 stella.Parameter
get, set
 
Methods inherited from interface util.PropertyBearing
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getLocalized, getProperties, getProperty, getResource, getResourceAsStream, getResources, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_BIND

public static final String KEY_BIND
The key in the Map for auto-binding of the trigger.

See Also:
Constant Field Values

DEFBIND

protected static final boolean DEFBIND
The default auto-binding as a RemoteParameter.

See Also:
Constant Field Values

stubs

private List<RmiListener> stubs
A list of registered rmi listners.

Constructor Detail

AbstractRemoteParameter

protected AbstractRemoteParameter(Map prop)
Constructs a new remote parameter. Sets the binding properties. Binding is done in the #bind method, which is called only in the init() section.

Method Detail

init

public void init()
Binds this trigger to the registry.

Specified by:
init in interface Initializable
Overrides:
init in class AbstractParameter

exit

public void exit()
Unbinds from registry, if bound.

Specified by:
exit in interface ExitCleaning
Overrides:
exit in class AbstractParameter

rescanned

protected double rescanned(String key,
                           String old,
                           String newval)
If the bind property changed, we deregister from our current binding and re-instantiate a new binding thread.

Overrides:
rescanned in class AbstractParameter

bindToRegistry

public boolean bindToRegistry()
                       throws RemoteException
Binds to registry.

Specified by:
bindToRegistry in interface RmiCaster
Returns:
True if successful.
Throws:
RemoteException

unbindFromRegistry

public boolean unbindFromRegistry()
                           throws RemoteException
Unbinds from registry.

Specified by:
unbindFromRegistry in interface RmiCaster
Returns:
True if successful.
Throws:
RemoteException

remoteGet

public Object remoteGet()
                 throws RemoteException
The remote edge of this trigger.

Specified by:
remoteGet in interface RemoteParameter
Throws:
RemoteException

addRmiListener

public void addRmiListener(RmiListener ear)
                    throws RemoteException
Adds a listener for notification on exit.

Specified by:
addRmiListener in interface RemoteParameter
Throws:
RemoteException

removeRmiListener

public void removeRmiListener(RmiListener ear)
                       throws RemoteException
Removes a listener.

Specified by:
removeRmiListener in interface RemoteParameter
Throws:
RemoteException

isValid

public boolean isValid()
                throws RemoteException
Returns true.

Specified by:
isValid in interface RmiCaster
Throws:
RemoteException