openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1434711 - in /openwebbeans/trunk: webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/ webbeans-impl/src/main/java/org/apache/webbeans/config/ webbeans-impl/src/main/java/org/apache/webbeans/proxy/ webbeans-impl/src/main/jav...
Date Thu, 17 Jan 2013 15:16:27 GMT
Author: struberg
Date: Thu Jan 17 15:16:27 2013
New Revision: 1434711

URL: http://svn.apache.org/viewvc?rev=1434711&view=rev
Log:
OWB-344 remove unused code

Removed:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/OpenWebBeansClassLoaderProvider.java
Modified:
    openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java

Modified: openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java?rev=1434711&r1=1434710&r2=1434711&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
(original)
+++ openwebbeans/trunk/webbeans-clustering/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
Thu Jan 17 15:16:27 2013
@@ -44,7 +44,6 @@ import org.apache.webbeans.context.Sessi
 import org.apache.webbeans.conversation.ConversationManager;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
-import org.apache.webbeans.proxy.javassist.OpenWebBeansClassLoaderProvider;
 import org.apache.webbeans.spi.FailOverService;
 import org.apache.webbeans.web.context.SessionContextManager;
 import org.apache.webbeans.web.context.WebContextsService;
@@ -92,7 +91,6 @@ public class DefaultOwbFailOverService i
 
         if (supportFailOver || supportPassivation)
         {
-            OpenWebBeansClassLoaderProvider.initProxyFactoryClassLoaderProvider();
             value = config.getProperty(CONFIG_RESOURCES_SERIALIZATION_HANDLER);
 
             if (value != null)

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java?rev=1434711&r1=1434710&r2=1434711&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
Thu Jan 17 15:16:27 2013
@@ -47,7 +47,6 @@ import org.apache.webbeans.portable.even
 import org.apache.webbeans.proxy.InterceptorDecoratorProxyFactory;
 import org.apache.webbeans.proxy.NormalScopeProxyFactory;
 import org.apache.webbeans.proxy.ProxyFactory;
-import org.apache.webbeans.proxy.javassist.OpenWebBeansClassLoaderProvider;
 import org.apache.webbeans.service.DefaultLoaderService;
 import org.apache.webbeans.spi.ContextsService;
 import org.apache.webbeans.spi.LoaderService;
@@ -142,7 +141,6 @@ public class WebBeansContext
         proxyFactoryRemove = serviceMap.containsKey(ProxyFactory.class)
             ? (ProxyFactory) serviceMap.get(ProxyFactory.class)
             : new ProxyFactory(this);
-        OpenWebBeansClassLoaderProvider.initProxyFactoryClassLoaderProvider();
 
         // Allow the WebBeansContext itself to be looked up
         managerMap.put(getClass(), this);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java?rev=1434711&r1=1434710&r2=1434711&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ProxyFactory.java
Thu Jan 17 15:16:27 2013
@@ -19,8 +19,6 @@
 package org.apache.webbeans.proxy;
 
 import java.io.Serializable;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Type;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -37,16 +35,13 @@ import javax.enterprise.inject.spi.Decor
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.component.OwbBean;
 import org.apache.webbeans.component.ResourceBean;
-import org.apache.webbeans.config.OpenWebBeansConfiguration;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
 import org.apache.webbeans.decorator.DelegateHandler;
 import org.apache.webbeans.decorator.WebBeansDecorator;
-import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.intercept.DependentScopedBeanInterceptorHandlerRemove;
 import org.apache.webbeans.intercept.InterceptorData;
 import org.apache.webbeans.intercept.InterceptorHandlerPleaseRemove;
-import org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandlerRemove;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptorBeanPleaseRemove;
 import org.apache.webbeans.proxy.javassist.JavassistFactory;
 import org.apache.webbeans.util.ClassUtil;
@@ -145,41 +140,6 @@ public final class ProxyFactory
         return null;
     }
 
-
-    /**
-     * @deprecated uses old proxy
-     */
-    public  Object createNormalScopedBeanProxyRemove(OwbBean<?> bean, CreationalContext<?>
creationalContext)
-    {
-        Object result = null;
-        try
-        {
-            Class<?> proxyClass = normalScopedBeanProxyClassesRemove.get(bean);
-            if (proxyClass == null)
-            {
-                proxyClass = createProxyClassRemove(bean);
-                normalScopedBeanProxyClassesRemove.putIfAbsent(bean, proxyClass);
-            }
-
-
-            result = createProxyRemove(proxyClass);
-
-            if (!(bean instanceof WebBeansDecorator<?>) && !(bean instanceof
WebBeansInterceptorBeanPleaseRemove<?>))
-            {
-                InterceptorHandlerPleaseRemove interceptorHandler = createInterceptorHandlerRemove(bean,
creationalContext);
-
-                setHandler(result, interceptorHandler);
-            }
-        }
-        catch (Exception e)
-        {
-            WebBeansUtil.throwRuntimeExceptions(e);
-        }
-
-        return result;
-    }
-
-
     /**
      * @deprecated uses old proxy
      */
@@ -192,87 +152,6 @@ public final class ProxyFactory
     /**
      * @deprecated uses old proxy
      */
-    private InterceptorHandlerPleaseRemove createInterceptorHandlerRemove(OwbBean<?>
bean, CreationalContext<?> creationalContext)
-    {
-        String scopeClassName = bean.getScope().getName();
-        Class<? extends InterceptorHandlerPleaseRemove> interceptorHandlerClass = null;
-        if (!interceptorHandlerClasses.containsKey(scopeClassName))
-        {
-            String proxyMappingConfigKey = OpenWebBeansConfiguration.PROXY_MAPPING_PREFIX
+ scopeClassName;
-            String className = bean.getWebBeansContext().getOpenWebBeansConfiguration().getProperty(proxyMappingConfigKey);
-            if (className != null)
-            {
-                try
-                {
-                    interceptorHandlerClass = (Class<? extends InterceptorHandlerPleaseRemove>)
Class.forName(className, true, WebBeansUtil.getCurrentClassLoader());
-                }
-                catch (ClassNotFoundException e)
-                {
-                    throw new WebBeansConfigurationException("Configured InterceptorHandler
"
-                                                             + className
-                                                             +" cannot be found",
-                                                             e);
-                }
-            }
-            else
-            {
-                // we need to explicitely store a class because ConcurrentHashMap will throw
a NPE if value == null
-                interceptorHandlerClass = NormalScopedBeanInterceptorHandlerRemove.class;
-            }
-
-            interceptorHandlerClasses.put(scopeClassName, interceptorHandlerClass);
-        }
-        else
-        {
-            interceptorHandlerClass = interceptorHandlerClasses.get(scopeClassName);
-        }
-
-        if (interceptorHandlerClass.equals(NormalScopedBeanInterceptorHandlerRemove.class))
-        {
-            // this is faster that way...
-            return new NormalScopedBeanInterceptorHandlerRemove(bean, creationalContext);
-        }
-        else
-        {
-            try
-            {
-                Constructor ct = interceptorHandlerClass.getConstructor(OwbBean.class, CreationalContext.class);
-                return (InterceptorHandlerPleaseRemove) ct.newInstance(bean, creationalContext);
-            }
-            catch (NoSuchMethodException e)
-            {
-                throw new WebBeansConfigurationException("Configured InterceptorHandler "
-                                                         + interceptorHandlerClass.getName()
-                                                         +" has the wrong contructor",
-                                                         e);
-            }
-            catch (InvocationTargetException e)
-            {
-                throw new WebBeansConfigurationException("Configured InterceptorHandler "
-                                                         + interceptorHandlerClass.getName()
-                                                         +" has the wrong contructor",
-                                                         e);
-            }
-            catch (InstantiationException e)
-            {
-                throw new WebBeansConfigurationException("Configured InterceptorHandler "
-                                                         + interceptorHandlerClass.getName()
-                                                         +" has the wrong contructor",
-                                                         e);
-            }
-            catch (IllegalAccessException e)
-            {
-                throw new WebBeansConfigurationException("Configured InterceptorHandler "
-                                                         + interceptorHandlerClass.getName()
-                                                         +" has the wrong contructor",
-                                                         e);
-            }
-        }
-    }
-
-    /**
-     * @deprecated uses old proxy
-     */
     public Object createBuildInBeanProxyRemove(OwbBean<?> bean)
     {
         Object result = null;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java?rev=1434711&r1=1434710&r2=1434711&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/JavassistFactory.java
Thu Jan 17 15:16:27 2013
@@ -56,21 +56,9 @@ public class JavassistFactory
         }
         catch(RuntimeException e)
         {
-            if(classLoaderProvider instanceof OpenWebBeansClassLoaderProvider)
-            {
-                ((OpenWebBeansClassLoaderProvider)classLoaderProvider).useCurrentClassLoader();
-            }
-
             //try again with updated class loader
             return doPrivilegedCreateClass(factory);
         }
-        finally
-        {
-            if(classLoaderProvider instanceof OpenWebBeansClassLoaderProvider)
-            {
-                ((OpenWebBeansClassLoaderProvider)classLoaderProvider).reset();
-            }
-        }
     }
 
     public Object createProxy(Class<?> proxyClass)



Mime
View raw message