visad.collab
Class RemoteDisplayMonitorImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by visad.collab.RemoteDisplayMonitorImpl
All Implemented Interfaces:
Serializable, Remote, EventListener, DisplayMonitor, RemoteDisplayMonitor, ControlListener, DisplayListener, MessageListener, ScalarMapListener

public class RemoteDisplayMonitorImpl
extends UnicastRemoteObject
implements RemoteDisplayMonitor

RemoteDisplayMonitorImpl is the implementation of the VisAD RemoteDisplayMonitor class.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface visad.collab.DisplayMonitor
UNKNOWN_LISTENER_ID
 
Constructor Summary
RemoteDisplayMonitorImpl(DisplayMonitorImpl dpyMonitor)
          Creates a remotely-accessible wrapper for the specified DisplayMonitor
 
Method Summary
 void addListener(MonitorCallback l, int id)
          Adds this listener to the remote DisplayMonitor.
 void addListener(RemoteDisplay rd, int id)
          Adds this remote display to the remote DisplayMonitor.
 void addRemoteListener(RemoteDisplay rd)
          Unusable stub.
 int checkID(int id)
          Asks remote DisplayMonitor to check this ID for uniqueness.
 void controlChanged(ControlEvent e)
          Forwards the event to the adapted remote DisplayMonitor.
 void controlChanged(ScalarMapControlEvent e)
          Forwards the event to the adapted remote DisplayMonitor.
 void destroy()
          destroy this monitor
 void displayChanged(DisplayEvent e)
          Forwards the event to the adapted remote DisplayMonitor.
 int getConnectionID(RemoteDisplay rmtDpy)
          Return the ID associated with the specified RemoteDisplay.
 boolean hasEventQueued(Control ctl)
          Unusable stub.
 boolean hasEventQueued(int originator, Control ctl)
          Unusable stub.
 boolean isEmpty()
           
 void mapChanged(ScalarMapEvent e)
          Forwards the event to the adapted remote DisplayMonitor.
 void notifyListeners(MonitorEvent evt)
          Forwards the event to the remote DisplayMonitor.
 void receiveMessage(MessageEvent msg)
          Handles MessageEvent forwarding.
 void setDisplaySync(DisplaySync sync)
          Set the display synchronization object for this display
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteDisplayMonitorImpl

public RemoteDisplayMonitorImpl(DisplayMonitorImpl dpyMonitor)
                         throws RemoteException
Creates a remotely-accessible wrapper for the specified DisplayMonitor

Parameters:
dpyMonitor - The local DisplayMonitor object to adapt.
Throws:
RemoteException - If there was an RMI-related problem.
Method Detail

displayChanged

public void displayChanged(DisplayEvent e)
                    throws RemoteException,
                           RemoteVisADException
Forwards the event to the adapted remote DisplayMonitor.

Specified by:
displayChanged in interface DisplayListener
Parameters:
e - The DisplayEvent to forward.
Throws:
RemoteException - If there was an RMI-related problem.
RemoteVisADException - If there was an internal problem.

mapChanged

public void mapChanged(ScalarMapEvent e)
Forwards the event to the adapted remote DisplayMonitor.

Specified by:
mapChanged in interface ScalarMapListener
Parameters:
e - The ScalarMapEvent to forward.

controlChanged

public void controlChanged(ScalarMapControlEvent e)
Forwards the event to the adapted remote DisplayMonitor.

Specified by:
controlChanged in interface ScalarMapListener
Parameters:
e - The ScalarMapEvent to forward.

controlChanged

public void controlChanged(ControlEvent e)
                    throws RemoteVisADException
Forwards the event to the adapted remote DisplayMonitor.

Specified by:
controlChanged in interface ControlListener
Parameters:
e - ControlEvent to forward
Throws:
RemoteVisADException - If there was an internal problem.

checkID

public int checkID(int id)
            throws RemoteException
Asks remote DisplayMonitor to check this ID for uniqueness.

Specified by:
checkID in interface DisplayMonitor
Parameters:
id - The identifier to check for uniqueness.
Throws:
RemoteException - If there was an RMI-related problem.

destroy

public void destroy()
             throws RemoteVisADException
destroy this monitor

Specified by:
destroy in interface DisplayMonitor
Throws:
RemoteVisADException

addListener

public void addListener(MonitorCallback l,
                        int id)
                 throws RemoteException,
                        RemoteVisADException
Adds this listener to the remote DisplayMonitor.

Specified by:
addListener in interface DisplayMonitor
Parameters:
l - The listener to add
id - The unique identifer (determined with checkID.)
Throws:
RemoteException - If there was an RMI-related problem.
RemoteVisADException - If there was an internal problem.

addListener

public void addListener(RemoteDisplay rd,
                        int id)
                 throws RemoteException,
                        RemoteVisADException
Adds this remote display to the remote DisplayMonitor.

Specified by:
addListener in interface DisplayMonitor
Parameters:
rd - The remote display to add
id - The unique identifer (determined with checkID.)
Throws:
RemoteException - If there was an RMI-related problem.
RemoteVisADException - If there was an internal problem.

addRemoteListener

public void addRemoteListener(RemoteDisplay rd)
                       throws RemoteException,
                              RemoteVisADException
Unusable stub. Cannot connect two RemoteDisplayMonitors.

Specified by:
addRemoteListener in interface DisplayMonitor
Parameters:
rd - Ignored.
Throws:
RemoteException - If there was an RMI-related problem.
RemoteVisADException - ALWAYS thrown.

getConnectionID

public int getConnectionID(RemoteDisplay rmtDpy)
                    throws RemoteException
Return the ID associated with the specified RemoteDisplay.

Specified by:
getConnectionID in interface DisplayMonitor
Returns:
UNKNOWN_LISTENER_ID if not found; otherwise, returns the ID.
Throws:
RemoteException

notifyListeners

public void notifyListeners(MonitorEvent evt)
                     throws RemoteVisADException
Forwards the event to the remote DisplayMonitor.

Specified by:
notifyListeners in interface DisplayMonitor
Parameters:
evt - The event to forward.
Throws:
RemoteVisADException - If there was an internal problem.

hasEventQueued

public boolean hasEventQueued(int originator,
                              Control ctl)
                       throws RemoteException
Unusable stub. Unimplemented.

Specified by:
hasEventQueued in interface DisplayMonitor
Parameters:
originator - Ignored.
ctl - Ignored.
Throws:
RemoteException - ALWAYS thrown.

isEmpty

public boolean isEmpty()
                throws RemoteException
Specified by:
isEmpty in interface DisplayMonitor
Throws:
RemoteException

hasEventQueued

public boolean hasEventQueued(Control ctl)
                       throws RemoteException
Unusable stub. Unimplemented.

Specified by:
hasEventQueued in interface DisplayMonitor
Parameters:
ctl - Ignored.
Throws:
RemoteException - ALWAYS thrown.

receiveMessage

public void receiveMessage(MessageEvent msg)
                    throws RemoteException
Handles MessageEvent forwarding.

Specified by:
receiveMessage in interface MessageListener
Parameters:
msg - The message to forward.
Throws:
RemoteException

setDisplaySync

public void setDisplaySync(DisplaySync sync)
                    throws RemoteException
Set the display synchronization object for this display

Specified by:
setDisplaySync in interface DisplayMonitor
Throws:
RemoteException

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class RemoteObject