/** * This is a convenience method to lookup a remote object by name within the naming context. * * @exception javax.naming.NamingException if the object with that name could not be found. */ public static java.rmi.Remote lookupObject(String publishedName, java.lang.Class anInterface) throws javax.naming.NamingException { Context ic = new InitialContext(); java.lang.Object objRef = ic.lookup(publishedName); return (java.rmi.Remote) PortableRemoteObject.narrow(objRef, anInterface); }