/** * Crete a new Context's instance. */ public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext(environment); } else { return null; } }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Crete a new Context's instance. */ @SuppressWarnings("unchecked") @Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws NamingException { if ((ContextBindings.isThreadBound()) || (ContextBindings.isClassLoaderBound())) { return new SelectorContext((Hashtable<String,Object>)environment); } return null; }
/** * Get a new (writable) initial context. */ public Context getInitialContext(Hashtable environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext(environment, true); } else { // If the thread is not bound, return a shared writable context if (initialContext == null) initialContext = new NamingContext(environment, MAIN); return initialContext; } }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get a new (writable) initial context. */ @SuppressWarnings("unchecked") @Override public Context getInitialContext(Hashtable<?,?> environment) throws NamingException { if (ContextBindings.isThreadBound() || (ContextBindings.isClassLoaderBound())) { // Redirect the request to the bound initial context return new SelectorContext( (Hashtable<String,Object>)environment, true); } // If the thread is not bound, return a shared writable context if (initialContext == null) { synchronized(javaURLContextFactory.class) { if (initialContext == null) { initialContext = new NamingContext( (Hashtable<String,Object>)environment, MAIN); } } } return initialContext; }
/** * Get the bound context. */ protected Context getBoundContext() throws NamingException { if (initialContext) { String ICName = IC_PREFIX; if (ContextBindings.isThreadBound()) { ICName += ContextBindings.getThreadName(); } else if (ContextBindings.isClassLoaderBound()) { ICName += ContextBindings.getClassLoaderName(); } Context initialContext = ContextBindings.getContext(ICName); if (initialContext == null) { // Allocating a new context and binding it to the appropriate // name initialContext = new NamingContext(env, ICName); ContextBindings.bindContext(ICName, initialContext); } return initialContext; } else { if (ContextBindings.isThreadBound()) { return ContextBindings.getThread(); } else { return ContextBindings.getClassLoader(); } } }
/** * Get the bound context. */ protected Context getBoundContext() throws NamingException { if (initialContext) { String ICName = IC_PREFIX; if (ContextBindings.isThreadBound()) { ICName += ContextBindings.getThreadName(); } else if (ContextBindings.isClassLoaderBound()) { ICName += ContextBindings.getClassLoaderName(); } Context initialContext = ContextBindings.getContext(ICName); if (initialContext == null) { // Allocating a new context and binding it to the appropriate // name initialContext = new NamingContext(env, ICName); ContextBindings.bindContext(ICName, initialContext); } return initialContext; } else { if (ContextBindings.isThreadBound()) { return ContextBindings.getThread(); } else { return ContextBindings.getClassLoader(); } } }