コード例 #1
1
ファイル: Utility.java プロジェクト: phan-pivotal/OSS
  /**
   * 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);
  }