static Remote exportObject(Remote obj, int port,
RMIServerSocketFactory serverSocketFactory)
throws RemoteException
{
UnicastServerRef sref = null;
if (obj instanceof RemoteObject)
sref = (UnicastServerRef) ((RemoteObject) obj).getRef();
if (sref == null)
sref = new UnicastServerRef(new ObjID(), port, serverSocketFactory);
Remote stub = sref.exportObject(obj);
// addStub(obj, stub);
// TODO Need to change the place of the stub repository
return stub;
}