public interface ListenerControlling extends Remote
#registerAt: Registers at the command-caster with the given
name.
The caster must be a remote reference to a RmiCommandCaster as well
as a RmiAcknowledgeListener and a RmiDoneListener.
Additionally,
we grab the caster and register it as an acknowledge and done listener
to our casting capabilities.#deregisterAt: Deregisters at the caster with the given name.
The caster must be a remote reference to a RmiCommandCaster as well
as a RmiAcknowledgeListener and a RmiDoneListener.
Additionally,
we remove it from our acknowledge and done listener list.external(java.rmi.Remote) If issued with true, we switch to external mode.
Only in this mode, a single external caster is allowed to register at this
object. If issued with false, we deregister from any external caster.
automatic(): Only if automatic mode is enabled, we accept
commands from a default command caster. No further rmi-methods, like
BuildingControl#openRoof are allowed, except the {link #manual}
command. If we switch to automatic mode, we register at the default
command caster, if specified. If an external caster was specified, it
is deregistered.manual(): Only in manual mode, further rmi-methods are accepted.
If we switch to manual mode, we deregister from any default or
external caster.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.| Modifier and Type | Method and Description |
|---|---|
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(stella.CommandEvent). |
void |
quit()
Parks the master listener by simply calling
GenericMaster.quitMaster(stella.CommandEvent). |
boolean |
reset()
Resets the master listener.
|
boolean |
setPassive(boolean passive)
Sets the listener in passive mode.
|
boolean automatic()
throws RemoteException
manual() method.RemoteExceptionboolean manual()
throws RemoteException
RemoteExceptionboolean setPassive(boolean passive)
throws RemoteException
RemoteExceptionboolean external(Remote caster) throws RemoteException
RemoteExceptionString getStatus() throws RemoteException
RemoteExceptionboolean initialize()
throws RemoteException
GenericMaster.initializeMaster(stella.CommandEvent).RemoteExceptionboolean reset()
throws RemoteException
GenericMaster.resetMaster(stella.CommandEvent).RemoteExceptionboolean park()
throws RemoteException
GenericMaster.parkMaster(stella.CommandEvent).RemoteExceptionvoid quit() throws RemoteException
GenericMaster.quitMaster(stella.CommandEvent).RemoteException