stella.rmi
Interface ListenerControlling

All Superinterfaces:
Remote
All Known Subinterfaces:
AdapterControlling, AdcControlling, AutoClearControlling, AutoFocusControlling, BuildingControlling, CalibrationControlling, CcdControlling, DitherControlling, DomeControlling, FocusControlling, GuiderControlling, PointingModelControlling, ReadoutModeControlling, SesControlling, ShelterControlling, TelescopeControlling, WifsipControlling
All Known Implementing Classes:
AdapterMaster, AuxiliaryMaster, CalibrationMaster, DomeMaster, EnvironmentMaster, GenericMaster, GenericMaster.Standalone, SesMaster, ShelterMaster, TelescopeMaster, TestReceiver, WifsipMaster

public interface ListenerControlling
extends Remote

This interface defines the remote capabilities of registering and deregister from a caster. It is intended to allow in-situ shifting from one caster to another without restarting the program. This is useful for e.g. shifting the building control from the automatic (SCS) mode to a manual (JLAunchBox) mode. The methods provided are:

So, how can we change the, e.g., EnvironmentMaster to accept commands from an alternate caster? First, we issue a external(java.rmi.Remote) to the master. Any default caster is deregistered, if we are in automatic mode. Then, we call #registerAt with the new external caster. A reference to this caster is kept locally. When we want to stop interference from the external caster we call external with false, which changes the state of the master to the state it was prior to the first call to external(java.rmi.Remote). If we have an externla caster active and then call either automatic() or manual(), the external caster is deregistered and the master attains the desired state.


Method Summary
 boolean automatic()
          Goes to automatic mode.
 boolean external(Remote caster)
          Allows or prohibits excess from an external caster.
 String getStatus()
          Returns a status decription of the master.
 boolean initialize()
          (Re)initializes a master listener.
 boolean manual()
          Goes to manual mode.
 boolean park()
          Parks the master listener by simply calling GenericMaster.parkMaster().
 void quit()
          Parks the master listener by simply calling GenericMaster.quitMaster().
 boolean reset()
          Resets the master listener.
 boolean setPassive(boolean passive)
          Sets the listener in passive mode.
 

Method Detail

automatic

boolean automatic()
                  throws RemoteException
Goes to automatic mode. In automatic mode, we register at a default caster and accept commands sent from this caster. Other access, like RMI from the outside is forbidden, except the manual() method.

Returns:
True if automatic mode was attained.
Throws:
RemoteException

manual

boolean manual()
               throws RemoteException
Goes to manual mode. In manual, we deregister from a default caster and allow access to RMI-bound clients (e.g. {link BuldingControlling#openRoof}).

Returns:
True if manual mode was attained.
Throws:
RemoteException

setPassive

boolean setPassive(boolean passive)
                   throws RemoteException
Sets the listener in passive mode. This is a workaround if any crucial parts of the server fails that cannot be fixed easiliy. In passiv mode, any remote command received is answered immedeately with a complete.

Throws:
RemoteException

external

boolean external(Remote caster)
                 throws RemoteException
Allows or prohibits excess from an external caster. If a default caster was specified at a call to this method with true, this caster is deregistered. If called with false, the old master state is reestablished.

Returns:
True if everything went o.k.
Throws:
RemoteException

getStatus

String getStatus()
                 throws RemoteException
Returns a status decription of the master. This rmi-method should be enabled also in automatic mode.

Throws:
RemoteException

initialize

boolean initialize()
                   throws RemoteException
(Re)initializes a master listener. In a normal implementation, this metohd simply calls GenericMaster.initializeMaster().

Throws:
RemoteException

reset

boolean reset()
              throws RemoteException
Resets the master listener. In a normal implementation, this metohd simply calls GenericMaster.resetMaster().

Throws:
RemoteException

park

boolean park()
             throws RemoteException
Parks the master listener by simply calling GenericMaster.parkMaster().

Throws:
RemoteException

quit

void quit()
          throws RemoteException
Parks the master listener by simply calling GenericMaster.quitMaster().

Throws:
RemoteException