public static Hashtable<String, String> getJNDIEnvironment(final int serverIndex) { return InVMInitialContextFactory.getJNDIEnvironment(serverIndex); } }
@Override public InitialContextFactory createInitialContextFactory(final Hashtable<?, ?> environment) throws NamingException { InitialContextFactory icf = null; if (environment != null) { String icfName = (String) environment.get("java.naming.factory.initial"); if (icfName != null) { Class c = null; try { c = Class.forName(icfName); } catch (ClassNotFoundException e) { InVMInitialContextFactoryBuilder.log.error("\"" + icfName + "\" cannot be loaded", e); throw new NamingException("\"" + icfName + "\" cannot be loaded"); } try { icf = (InitialContextFactory) c.newInstance(); } catch (InstantiationException e) { InVMInitialContextFactoryBuilder.log.error(c.getName() + " cannot be instantiated", e); throw new NamingException(c.getName() + " cannot be instantiated"); } catch (IllegalAccessException e) { InVMInitialContextFactoryBuilder.log.error(c.getName() + " instantiation generated an IllegalAccessException", e); throw new NamingException(c.getName() + " instantiation generated an IllegalAccessException"); } } } if (icf == null) { icf = new InVMInitialContextFactory(); } return icf; }
public static Hashtable<String, String> getJNDIEnvironment() { return InVMInitialContextFactory.getJNDIEnvironment(0); }