Exemplo n.º 1
0
  private static Context URLToContext(String url, Hashtable<?, ?> env) throws NamingException {
    rmiURLContextFactory factory = new rmiURLContextFactory();
    Object obj = factory.getObjectInstance(url, null, null, env);

    if (obj instanceof Context) {
      return (Context) obj;
    } else {
      throw (new NotContextException(url));
    }
  }
Exemplo n.º 2
0
 private static Object URLsToObject(String[] urls, Hashtable<?, ?> env) throws NamingException {
   rmiURLContextFactory factory = new rmiURLContextFactory();
   return factory.getObjectInstance(urls, null, null, env);
 }