Sketch of Client Implementation
public class ChatterImpl extends UnicastRemoteObject
implements Chatter {
public ChatterImpl(ChatApplet gui, String name)
throws RemoteException() {
this.gui = gui ;
server = (ChatServer)Naming.lookup(. . .);
server.register(this, name) ;
// Register self with chat server
}
public void notify(Message m) throws RemoteException {
gui.displayMessage(m) ;
}
. . .
}
We assume this implementation object is created by an applet, which passes itself to the remote object constructor. It should implement displayMessage().