import org.omg.CosNaming.*; import org.omg.CORBA.*; class ShapeListServant extends _ShapeListImplBase { private Shape theList[]; private int version; private static int n=0; ORB theOrb; public ShapeListServant(ORB orb){ System.out.println("Starting server"); theList = new Shape[100]; version = 0; theOrb = orb; } public Shape newShape(GraphicalObject g) throws ShapeListPackage.FullException { version++; Shape s = new ShapeServant( g, version); if(n >=100) throw new ShapeListPackage.FullException(); theList[n++] = s; theOrb.connect(s); return s; } public Shape[] allShapes(){ return theList; } public int getVersion() { return version; } }