edu.columbia.cs.cgui.rjfc.server
Class RJFCServer
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--edu.columbia.cs.cgui.rjfc.server.RJFCServer
- All Implemented Interfaces:
- Remote, Serializable, Server
- public class RJFCServer
- extends UnicastRemoteObject
- implements Server
The standard Server that a RJFC Viewer will connect to.
It is normally instantiated by an Application object, and handles
all of the RMI connectivity.
- See Also:
Viewer, Serialized Form
RJFCServer
public RJFCServer(String s,
Application ra)
throws RemoteException
- Constructs RJFCServer object and exports it on default port.
- Parameters:
s - the name of the RMI objectra - the application- Throws:
RemoteException - if there is an error thrown while remotely terminating
objects on the client side.
RJFCServer
public RJFCServer(int port,
String s,
Application ra)
throws RemoteException
- Constructs RJFCServer object and exports it on specified port.
- Parameters:
port - The port for exportings - the name of the RMI objectra - the application- Throws:
RemoteException - if there is an error thrown while remotely terminating
objects on the client side.
getDisplay
public RJFrame getDisplay(ClientInfo ci)
- Called by an instance of Application to get the main display that
corresponds to the specified client
- Parameters:
ci - the client- Returns:
- the corresponding display object
getClientHash
public Hashtable getClientHash()
- Called by an instance of Application to get the hashtable that
indexes clients to their reference objects
- Returns:
- the hashtable for this server
getFactory
public RJFCFactory getFactory(ClientInfo ci)
- Called by an instance of Application to get the factory that
corresponds to the specified client
- Parameters:
ci - the client- Returns:
- the corresponding factory
registerDisplay
public void registerDisplay(RJFrame display,
RJFCFactory f,
ClientInfo clientInfo)
throws RemoteException
- This method should be called remotely by clients when they first
initialize. It should pass the display hook to the server so that
the server can use RMI to add components onto the display panel,
and it should pass the factory so that the server or the application
can remotely instantiate objects on the client's machine. The
client's IP and port are also passed in, so that multiple connections
can be differentiated.
- Specified by:
registerDisplay in interface Server
- Parameters:
display - the main display panel for the client's applicationf - the factory to create the Swing components on the client sideci - the ip and port numbers for the client- Throws:
RemoteException - if there is an error thrown while remotely instantiating
objects on the client side.- See Also:
RJFrame,
ClientInfo,
RJFCFactory
disconnectDisplay
public void disconnectDisplay(ClientInfo clientInfo)
throws RemoteException
- This method should be called remotely by clients when they are
terminating their connection. The client's IP and port are passed
in, so that the correct client can be disconnected.
- Specified by:
disconnectDisplay in interface Server
- Parameters:
ci - the ip and port numbers for the client- Throws:
RemoteException - if there is an error thrown while remotely terminating
objects on the client side.- See Also:
ClientInfo