RemoteRef ref;
if (csf == null) {
ref = new UnicastRef(host, port, new ObjID(ObjID.REGISTRY_ID));
} else {
ref = new UnicastRef2(host, port, csf,
new ObjID(ObjID.REGISTRY_ID));
}
return (Registry) regClass.getConstructor(
new Class[] { RemoteRef.class }).newInstance(
new Object[] { ref });