Outubro 2008
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          89
Java class ShapeListServant implements interface ShapeList
import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
import java.util.Vector;
public class ShapeListServant extends UnicastRemoteObject implements ShapeList
{
 private Vector theList; // contains the list of Shapes 1
   private int version;
public ShapeListServant()throws RemoteException{...}
public Shape newShape(GraphicalObject g) throws RemoteException { 2
version++;
       Shape s = new ShapeServant( g, version); 3
        theList.addElement(s);               
        return s;
}
public  Vector allShapes()throws RemoteException{...}
  public int getVersion() throws RemoteException { ... }
}