public class SwitchRelay extends UnicastRemoteObject implements RemoteSwitch, RmiListener
| Modifier and Type | Field and Description |
|---|---|
private String |
bind |
private String |
naming |
private RemoteSwitch |
relay |
private List<RmiListener> |
stubs
A list of registered rmi listners.
|
refNAMING_EXTENSION| Constructor and Description |
|---|
SwitchRelay(String rmi,
String local) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRmiListener(RmiListener ear)
Adds a listener for notification on exit.
|
boolean |
bindToRegistry() |
void |
disconnect(RmiCaster from) |
boolean |
isConnected() |
boolean |
isValid() |
static void |
main(String[] arg) |
Object |
remoteGet()
The remote edge of this trigger.
|
Boolean |
remoteGetTrigger()
Retrieves the trigger value as a boolean.
|
boolean |
remoteIsTrue()
Retrieves the trigger value as a primitive boolean.
|
Date |
remoteToggleTime()
Retrieves the trigger toggle time using RMI.
|
void |
removeRmiListener(RmiListener ear)
Removes a listener.
|
private boolean |
startRelay() |
boolean |
switchOff()
The remote switching is diverted to the servers
switchOn(long). |
boolean |
switchOn(long maxtime)
The remote switching is diverted to the servers
switchOn(long). |
boolean |
unbindFromRegistry() |
clone, exportObject, exportObject, exportObject, unexportObjectgetClientHost, getLog, setLogprivate RemoteSwitch relay
private String naming
private String bind
private List<RmiListener> stubs
public SwitchRelay(String rmi, String local) throws RemoteException
RemoteExceptionprivate boolean startRelay()
throws RemoteException
RemoteExceptionpublic boolean bindToRegistry()
throws RemoteException
bindToRegistry in interface RmiCasterRemoteExceptionpublic boolean unbindFromRegistry()
throws RemoteException
unbindFromRegistry in interface RmiCasterRemoteExceptionpublic void addRmiListener(RmiListener ear) throws RemoteException
addRmiListener in interface RemoteParameterRemoteExceptionpublic void removeRmiListener(RmiListener ear) throws RemoteException
removeRmiListener in interface RemoteParameterRemoteExceptionpublic Object remoteGet() throws RemoteException
remoteGet in interface RemoteParameterRemoteExceptionpublic Boolean remoteGetTrigger() throws RemoteException
RemoteTriggerremoteGetTrigger in interface RemoteTriggerRemoteExceptionpublic boolean remoteIsTrue()
throws RemoteException
RemoteTriggerremoteIsTrue in interface RemoteTriggerRemoteExceptionpublic Date remoteToggleTime() throws RemoteException
RemoteTriggerremoteToggleTime in interface RemoteTriggerRemoteExceptionpublic boolean switchOn(long maxtime)
throws RemoteException
switchOn(long).switchOn in interface RemoteSwitchmaxtime - The maximum illumination time, in ms. Zero for unlimitied.RemoteExceptionpublic boolean switchOff()
throws RemoteException
switchOn(long).switchOff in interface RemoteSwitchRemoteExceptionpublic boolean isValid()
throws RemoteException
isValid in interface RmiCasterRemoteExceptionpublic boolean isConnected()
throws RemoteException
isConnected in interface RmiListenerRemoteExceptionpublic void disconnect(RmiCaster from) throws RemoteException
disconnect in interface RmiListenerRemoteExceptionpublic static void main(String[] arg) throws RemoteException
RemoteException