/** * Binds a naming context to a thread. * * @param name Name of the context */ public static void bindThread(Object name) throws NamingException { bindThread(name, null); }
/** * Binds a naming context to a thread. * * @param name Name of the context */ public static void bindThread(Object name) throws NamingException { bindThread(name, null); }
/** * Binds a naming context to a thread. * * @param name Name of the context */ public static void bindThread(Object name) throws NamingException { bindThread(name, null); }
/** * Binds a naming context to a thread. * * @param name Name of the context */ public static void bindThread(Object name) throws NamingException { bindThread(name, null); }
/** * Binds a naming context to a thread. * * @param name Name of the context * * @deprecated - unused */ @Deprecated public static void bindThread(Object name) throws NamingException { bindThread(name, null); }
/** * Binds a naming context to a thread. * * @param name Name of the context * * @deprecated - unused */ @Deprecated public static void bindThread(Object name) throws NamingException { bindThread(name, null); }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and realoading of the context. * * @return the previous context class loader */ private ClassLoader bindThread() { ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(getClassLoader()); if (isUseNaming()) { try { ContextBindings.bindThread(this, this); } catch (Throwable e) { log.log(Level.WARNING, LogFacade.BIND_THREAD_EXCEPTION, e); } } return oldContextClassLoader; }
public void contextExited(ThreadContext exitedContext, ThreadContext reenteredContext) { // unbind the new context ContextBindings.unbindThread(OPENEJB_CONTEXT); // attempt to restore the old context Data data = exitedContext.get(Data.class); if (data != null && data.oldContextName != null) { try { ContextBindings.bindThread(data.oldContextName); } catch (NamingException e) { } } }
public void contextEntered(ThreadContext oldContext, ThreadContext newContext) { // save off the old context if possible try { Data data = new Data(getThreadName()); newContext.set(Data.class, data); } catch (NamingException ignored) { } // set the new context try { ContextBindings.bindThread(OPENEJB_CONTEXT); } catch (NamingException e) { ContextBindings.unbindContext(OPENEJB_CONTEXT); throw new IllegalArgumentException("Unable to bind OpenEJB enc"); } }
/** * {@inheritDoc} */ public void contextExited(final ThreadContext exitedContext, final ThreadContext reenteredContext) { // unbind the new context ContextBindings.unbindThread(OPENEJB_CONTEXT, null); // attempt to restore the old context final Data data = exitedContext.get(Data.class); if (data != null && data.oldContextName != null) { try { ContextBindings.bindThread(data.oldContextName, null); } catch (final NamingException e) { logger.error("Exception in method contextExited", e); } } }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and reloading of the context. * * @return the previous context class loader */ protected ClassLoader bindThread() { ClassLoader oldContextClassLoader = bind(false, null); if (isUseNaming()) { try { ContextBindings.bindThread(this, getNamingToken()); } catch (NamingException e) { // Silent catch, as this is a normal case during the early // startup stages } } return oldContextClassLoader; }
/** * {@inheritDoc} */ public void contextExited(ThreadContext exitedContext, ThreadContext reenteredContext) { // unbind the new context ContextBindings.unbindThread(OPENEJB_CONTEXT); // attempt to restore the old context Data data = exitedContext.get(Data.class); if (data != null && data.oldContextName != null) { try { ContextBindings.bindThread(data.oldContextName); } catch (NamingException e) { logger.error("Exception in method contextExited", e); } } }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and reloading of the context. * * @return the previous context class loader */ protected ClassLoader bindThread() { ClassLoader oldContextClassLoader = bind(false, null); if (isUseNaming()) { try { ContextBindings.bindThread(this, getNamingToken()); } catch (NamingException e) { // Silent catch, as this is a normal case during the early // startup stages } } return oldContextClassLoader; }
/** * {@inheritDoc} */ public void contextEntered(ThreadContext oldContext, ThreadContext newContext) { // save off the old context if possible try { Data data = new Data(getThreadName()); newContext.set(Data.class, data); } catch (NamingException ignored) { } // set the new context try { ContextBindings.bindThread(OPENEJB_CONTEXT); } catch (NamingException e) { ContextBindings.unbindContext(OPENEJB_CONTEXT); throw new IllegalArgumentException("Unable to bind OpenEJB enc"); } }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and realoading of the context. * * @return the previous context class loader */ protected ClassLoader bindThread() { ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); if (getLoader() != null && getLoader().getClassLoader() != null) { Thread.currentThread().setContextClassLoader (getLoader().getClassLoader()); } if (isUseNaming()) { try { ContextBindings.bindThread(this, this); } catch (NamingException e) { // Silent catch, as this is a normal case during the early // startup stages } } return oldContextClassLoader; }
/** * {@inheritDoc} */ public void contextEntered(final ThreadContext oldContext, final ThreadContext newContext) { // save off the old context if possible try { final Data data = new Data(getThreadName()); newContext.set(Data.class, data); } catch (final NamingException ignored) { // no-op } // set the new context try { ContextBindings.bindThread(OPENEJB_CONTEXT, null); } catch (final NamingException e) { ContextBindings.unbindContext(OPENEJB_CONTEXT, null); throw new IllegalArgumentException("Unable to bind OpenEJB enc"); } }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and realoading of the context. * * @return the previous context class loader */ protected ClassLoader bindThread() { ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); if (getResources() == null) return oldContextClassLoader; if (getLoader().getClassLoader() != null) { Thread.currentThread().setContextClassLoader (getLoader().getClassLoader()); } DirContextURLStreamHandler.bindThread(getResources()); if (isUseNaming()) { try { ContextBindings.bindThread(this, this); } catch (NamingException e) { // Silent catch, as this is a normal case during the early // startup stages } } return oldContextClassLoader; }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and realoading of the context. * * @return the previous context class loader */ protected ClassLoader bindThread() { ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); if (getResources() == null) return oldContextClassLoader; if (getLoader().getClassLoader() != null) { Thread.currentThread().setContextClassLoader (getLoader().getClassLoader()); } DirContextURLStreamHandler.bindThread(getResources()); if (isUseNaming()) { try { ContextBindings.bindThread(this, this); } catch (NamingException e) { // Silent catch, as this is a normal case during the early // startup stages } } return oldContextClassLoader; }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and realoading of the context. * * @return the previous context class loader */ private ClassLoader bindThread() { ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); if (getResources() == null) return oldContextClassLoader; if (getLoader().getClassLoader() != null) { Thread.currentThread().setContextClassLoader (getLoader().getClassLoader()); } DirContextURLStreamHandler.bind(getResources()); if (isUseNaming()) { try { ContextBindings.bindThread(this, this); } catch (NamingException e) { // Silent catch, as this is a normal case during the early // startup stages } } return oldContextClassLoader; }
/** * Bind current thread, both for CL purposes and for JNDI ENC support * during : startup, shutdown and realoading of the context. * * @return the previous context class loader */ protected ClassLoader bindThread() { ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); if (getResources() == null) return oldContextClassLoader; if (getLoader().getClassLoader() != null) { Thread.currentThread().setContextClassLoader (getLoader().getClassLoader()); } DirContextURLStreamHandler.bindThread(getResources()); if (isUseNaming()) { try { ContextBindings.bindThread(this, this); } catch (NamingException e) { // Silent catch, as this is a normal case during the early // startup stages } } return oldContextClassLoader; }