webbeans-jetty9/src/main/java/org/apache/webbeans/web/jetty9/JettyUtil.java [55:84]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(loader);
        try
        {
            BeanManagerImpl beanManager = WebBeansContext.currentInstance().getBeanManagerImpl();
            Producer producer = beanManager.getProducerForJavaEeComponent(instance.object.getClass());
            if (producer != null)
            {
                producer.dispose(instance.object);
            }
            else if (instance.context != null)
            {
                instance.context.release();
            }
        }
        finally
        {
            Thread.currentThread().setContextClassLoader(oldLoader);
        }
    }

    private static final class Instance
    {
        private Object object;
        private CreationalContext<?> context;

        private Instance(Object object, CreationalContext<?> context)
        {
            this.object = object;
            this.context = context;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



webbeans-tomcat/src/main/java/org/apache/webbeans/web/tomcat/TomcatUtil.java [52:81]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(loader);
        try
        {
            BeanManagerImpl beanManager = WebBeansContext.currentInstance().getBeanManagerImpl();
            Producer producer = beanManager.getProducerForJavaEeComponent(instance.object.getClass());
            if (producer != null)
            {
                producer.dispose(instance.object);
            }
            else if (instance.context != null)
            {
                instance.context.release();
            }
        }
        finally
        {
            Thread.currentThread().setContextClassLoader(oldLoader);
        }
    }

    private static final class Instance
    {
        private Object object;
        private CreationalContext<?> context;

        private Instance(Object object, CreationalContext<?> context)
        {
            this.object = object;
            this.context = context;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



