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)); } }
private static Object URLsToObject(String[] urls, Hashtable<?, ?> env) throws NamingException { rmiURLContextFactory factory = new rmiURLContextFactory(); return factory.getObjectInstance(urls, null, null, env); }