openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1384195 - in /openwebbeans/trunk: webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/ webbeans-impl/src/main/java/org/apache/webbeans/component/ webbeans-impl/src/main/java/org/apache/webbeans/config/ webbeans-impl/src/main/ja...
Date Thu, 13 Sep 2012 03:14:29 GMT
Author: dblevins
Date: Thu Sep 13 03:14:28 2012
New Revision: 1384195

URL: http://svn.apache.org/viewvc?rev=1384195&view=rev
Log:
Further refactoring to minimize javassist dependencies for proxies.  Boiled all javassist.util.proxy
dependencies to 5 classes.
OWB-701

Added:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/MethodHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/OpenWebBeansClassLoaderProvider.java
      - copied, changed from r1384167, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OpenWebBeansClassLoaderProvider.java
Removed:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OpenWebBeansClassLoaderProvider.java
Modified:
    openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContext.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/AbstractDecoratorMethodHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ApplicationScopedBeanInterceptorHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ResourceProxyHandler.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/SecurityUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
    openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsUtil.java
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/intercept/RequestScopedBeanInterceptorHandler.java

Modified: openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
(original)
+++ openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/common/proxy/EjbBeanProxyHandler.java
Thu Sep 13 03:14:28 2012
@@ -47,7 +47,7 @@ import org.apache.webbeans.ejb.common.in
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
 import org.apache.webbeans.util.ClassUtil;
 
-import javassist.util.proxy.MethodHandler;
+import org.apache.webbeans.proxy.MethodHandler;
 
 /**
  * EJB beans proxy handler.

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/BuildInOwbBean.java
Thu Sep 13 03:14:28 2012
@@ -30,7 +30,7 @@ import java.util.HashMap;
 import java.util.logging.Level;
 
 import javax.enterprise.context.spi.CreationalContext;
-import javassist.util.proxy.MethodHandler;
+import org.apache.webbeans.proxy.MethodHandler;
 
 import org.apache.webbeans.config.WebBeansContext;
 

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=1384195&r1=1384194&r2=1384195&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 Sep 13 03:14:28 2012
@@ -45,6 +45,7 @@ import org.apache.webbeans.plugins.Plugi
 import org.apache.webbeans.portable.AnnotatedElementFactory;
 import org.apache.webbeans.portable.events.ExtensionLoader;
 import org.apache.webbeans.proxy.JavassistProxyFactory;
+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;
@@ -134,7 +135,7 @@ public class WebBeansContext
         }
         loaderService = getService(LoaderService.class);
         securityService = getService(SecurityService.class);
-        WebBeansUtil.initProxyFactoryClassLoaderProvider();
+        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/decorator/AbstractDecoratorMethodHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/AbstractDecoratorMethodHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/AbstractDecoratorMethodHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/AbstractDecoratorMethodHandler.java
Thu Sep 13 03:14:28 2012
@@ -24,7 +24,7 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.lang.reflect.Method;
 
-import javassist.util.proxy.MethodHandler;
+import org.apache.webbeans.proxy.MethodHandler;
 
 public class AbstractDecoratorMethodHandler implements MethodHandler, Serializable
 {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/decorator/DelegateHandler.java
Thu Sep 13 03:14:28 2012
@@ -41,7 +41,7 @@ import org.apache.webbeans.exception.Web
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
 import org.apache.webbeans.util.WebBeansUtil;
 
-import javassist.util.proxy.MethodHandler;
+import org.apache.webbeans.proxy.MethodHandler;
 
 public class DelegateHandler implements InvocationHandler, MethodHandler, Serializable, Externalizable
 {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ApplicationScopedBeanInterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ApplicationScopedBeanInterceptorHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ApplicationScopedBeanInterceptorHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/ApplicationScopedBeanInterceptorHandler.java
Thu Sep 13 03:14:28 2012
@@ -24,7 +24,7 @@ import org.apache.webbeans.component.Owb
 
 
 /**
- * <p>This is a {@link javassist.util.proxy.MethodHandler} especially
+ * <p>This is a {@link org.apache.webbeans.proxy.MethodHandler} especially
  * made for &#064;ApplicationScoped beans.</p>
  * 
  * <p>Since there is only one single contextual instance of an &#064;ApplicationScoped
bean,

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/InterceptorHandler.java
Thu Sep 13 03:14:28 2012
@@ -33,7 +33,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.interceptor.InvocationContext;
-import javassist.util.proxy.MethodHandler;
+import org.apache.webbeans.proxy.MethodHandler;
 
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.component.OwbBean;

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/JavassistProxyFactory.java
Thu Sep 13 03:14:28 2012
@@ -24,6 +24,8 @@ import java.lang.reflect.InvocationTarge
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -37,7 +39,6 @@ import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.Decorator;
 
 import javassist.util.proxy.MethodFilter;
-import javassist.util.proxy.MethodHandler;
 import javassist.util.proxy.ProxyFactory;
 import javassist.util.proxy.ProxyFactory.ClassLoaderProvider;
 import javassist.util.proxy.ProxyObject;
@@ -54,9 +55,8 @@ import org.apache.webbeans.intercept.Int
 import org.apache.webbeans.intercept.InterceptorHandler;
 import org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler;
 import org.apache.webbeans.intercept.webbeans.WebBeansInterceptor;
+import org.apache.webbeans.proxy.javassist.OpenWebBeansClassLoaderProvider;
 import org.apache.webbeans.util.ClassUtil;
-import org.apache.webbeans.util.OpenWebBeansClassLoaderProvider;
-import org.apache.webbeans.util.SecurityUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
 public final class JavassistProxyFactory
@@ -81,6 +81,18 @@ public final class JavassistProxyFactory
     private Map<String, Class<? extends InterceptorHandler>> interceptorHandlerClasses
=
             new ConcurrentHashMap<String, Class<? extends InterceptorHandler>>();
 
+    public static Class<?> doPrivilegedCreateClass(ProxyFactory factory)
+    {
+        if (System.getSecurityManager() == null)
+        {
+            return factory.createClass();
+        }
+        else
+        {
+            return (Class<?>) AccessController.doPrivileged(new PrivilegedActionForProxyFactory(factory));
+        }
+    }
+
     public void setHandler(Object proxy, MethodHandler handler)
     {
         ((ProxyObject)proxy).setHandler(handler);
@@ -190,7 +202,7 @@ public final class JavassistProxyFactory
 
         if (proxyClass == null)
         {
-            proxyClass = SecurityUtil.doPrivilegedCreateClass(factory);
+            proxyClass = doPrivilegedCreateClass(factory);
             typeToProxyClassMap.putIfAbsent(iface, proxyClass);
             // don't care if we were beaten in updating the iface->proxyclass map
         }
@@ -206,7 +218,7 @@ public final class JavassistProxyFactory
         {
             ProxyFactory fact = createProxyFactory(bean);
             
-            clazz = SecurityUtil.doPrivilegedCreateClass(fact);
+            clazz = doPrivilegedCreateClass(fact);
         }
         catch(Exception e)
         {
@@ -215,7 +227,18 @@ public final class JavassistProxyFactory
         return clazz;
         
     }
-    
+
+    public Object createProxy(MethodHandler handler, Class<?>[] interfaces)
+        throws InstantiationException, IllegalAccessException
+    {
+        ProxyFactory pf = new ProxyFactory();
+        pf.setInterfaces(interfaces);
+        pf.setHandler(handler);
+
+        return getProxyClass(pf).newInstance();
+    }
+
+
     public  Object createNormalScopedBeanProxy(OwbBean<?> bean, CreationalContext<?>
creationalContext)
     {
         Object result = null;
@@ -485,7 +508,7 @@ public final class JavassistProxyFactory
         Class<?> clazz = null;
         try
         {
-            clazz = SecurityUtil.doPrivilegedCreateClass(factory);            
+            clazz = doPrivilegedCreateClass(factory);
         }
         catch(RuntimeException e)
         {
@@ -495,7 +518,7 @@ public final class JavassistProxyFactory
             }
 
             //try again with updated class loader
-            clazz = SecurityUtil.doPrivilegedCreateClass(factory);
+            clazz = doPrivilegedCreateClass(factory);
         }
         finally
         {
@@ -567,4 +590,19 @@ public final class JavassistProxyFactory
                         && method.getReturnType() == Void.TYPE);
         }
     }
+
+    protected static class PrivilegedActionForProxyFactory implements PrivilegedAction<Object>
+    {
+        private ProxyFactory factory;
+
+        protected PrivilegedActionForProxyFactory(ProxyFactory factory)
+        {
+            this.factory = factory;
+        }
+
+        public Object run()
+        {
+            return factory.createClass();
+        }
+    }
 }

Added: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/MethodHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/MethodHandler.java?rev=1384195&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/MethodHandler.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/MethodHandler.java
Thu Sep 13 03:14:28 2012
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.proxy;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface MethodHandler extends javassist.util.proxy.MethodHandler
+{
+}

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ResourceProxyHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ResourceProxyHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ResourceProxyHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/ResourceProxyHandler.java
Thu Sep 13 03:14:28 2012
@@ -27,7 +27,6 @@ import java.lang.reflect.InvocationHandl
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
-import javassist.util.proxy.MethodHandler;
 import org.apache.webbeans.component.ResourceBean;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.spi.ResourceInjectionService;

Copied: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/OpenWebBeansClassLoaderProvider.java
(from r1384167, openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OpenWebBeansClassLoaderProvider.java)
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/OpenWebBeansClassLoaderProvider.java?p2=openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/OpenWebBeansClassLoaderProvider.java&p1=openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OpenWebBeansClassLoaderProvider.java&r1=1384167&r2=1384195&rev=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OpenWebBeansClassLoaderProvider.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/javassist/OpenWebBeansClassLoaderProvider.java
Thu Sep 13 03:14:28 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.webbeans.util;
+package org.apache.webbeans.proxy.javassist;
 
 import javassist.util.proxy.ProxyFactory;
 
@@ -34,6 +34,11 @@ public class OpenWebBeansClassLoaderProv
         wrapped = ProxyFactory.classLoaderProvider;
     }
 
+    public static void initProxyFactoryClassLoaderProvider()
+    {
+        ProxyFactory.classLoaderProvider = new OpenWebBeansClassLoaderProvider();
+    }
+
     public void useCurrentClassLoader()
     {
         useCurrentClassLoader.set(true);

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/SecurityUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/SecurityUtil.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/SecurityUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/SecurityUtil.java
Thu Sep 13 03:14:28 2012
@@ -22,8 +22,6 @@ import java.lang.reflect.Method;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import javassist.util.proxy.ProxyFactory;
-
 /** @deprecated  use SecurityService instead */
 public class SecurityUtil
 {
@@ -64,33 +62,4 @@ public class SecurityUtil
         }
 
     }
-
-    public static Class<?> doPrivilegedCreateClass(ProxyFactory factory)
-    {
-        if (System.getSecurityManager() == null)
-        {
-            return factory.createClass();
-        }
-        else
-        {
-            return (Class<?>)AccessController.doPrivileged(new PrivilegedActionForProxyFactory(factory));
-        }
-    }
-
-
-    protected static class PrivilegedActionForProxyFactory implements PrivilegedAction<Object>
-    {
-        private ProxyFactory factory;
-
-        protected PrivilegedActionForProxyFactory(ProxyFactory factory)
-        {
-            this.factory = factory;
-        }
-
-        public Object run()
-        {
-            return factory.createClass();
-        }
-    }
-
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
Thu Sep 13 03:14:28 2012
@@ -90,7 +90,6 @@ import javax.interceptor.AroundInvoke;
 import javax.interceptor.AroundTimeout;
 import javax.interceptor.InvocationContext;
 
-import javassist.util.proxy.ProxyFactory;
 import org.apache.webbeans.annotation.AnnotationManager;
 import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.annotation.ApplicationScopeLiteral;
@@ -2856,11 +2855,6 @@ public final class WebBeansUtil
         throw new RuntimeException(e);
     }
 
-    public static void initProxyFactoryClassLoaderProvider()
-    {
-        ProxyFactory.classLoaderProvider = new OpenWebBeansClassLoaderProvider();
-    }
-
     /**
      * Return true if this annotated type represents a decorator.
      * @param annotatedType annotated type

Modified: openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
(original)
+++ openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsProxyHandler.java
Thu Sep 13 03:14:28 2012
@@ -42,7 +42,7 @@ import org.apache.webbeans.jms.JMSModel.
 import org.apache.webbeans.jms.component.JmsBean;
 import org.apache.webbeans.util.ClassUtil;
 
-import javassist.util.proxy.MethodHandler;
+import org.apache.webbeans.proxy.MethodHandler;
 
 public class JmsProxyHandler implements InvocationHandler, MethodHandler
 {

Modified: openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsUtil.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsUtil.java
(original)
+++ openwebbeans/trunk/webbeans-jms/src/main/java/org/apache/webbeans/jms/util/JmsUtil.java
Thu Sep 13 03:14:28 2012
@@ -20,8 +20,6 @@ package org.apache.webbeans.jms.util;
 
 import java.io.Serializable;
 
-import javassist.util.proxy.ProxyFactory;
-
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.MessageConsumer;
@@ -45,6 +43,7 @@ import org.apache.webbeans.exception.Web
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.jms.JMSModel;
 import org.apache.webbeans.jms.component.JmsBean;
+import org.apache.webbeans.proxy.MethodHandler;
 import org.apache.webbeans.spi.JNDIService;
 import org.apache.webbeans.util.Asserts;
 
@@ -166,27 +165,19 @@ public final class JmsUtil
      */
     public static Object createNewJmsProxy(JmsBean<?> jmsComponent, Class<?>
intf)
     {
-       Object result = null;
-
         try
         {
-            ProxyFactory pf = new ProxyFactory();
-            pf.setInterfaces(new Class<?>[] {
-                    Closable.class,
-                    Serializable.class,
-                    intf});
-            
-            pf.setHandler(new JmsProxyHandler(jmsComponent,intf));
+            final MethodHandler handler = new JmsProxyHandler(jmsComponent, intf);
+
+            final Class<?>[] interfaces = {Closable.class, Serializable.class, intf};
 
-            result = WebBeansContext.getInstance().getJavassistProxyFactory().getProxyClass(pf).newInstance();
+            return WebBeansContext.getInstance().getJavassistProxyFactory().createProxy(handler,
interfaces);
 
         }
         catch (Exception e)
         {
             throw new WebBeansException(e);
         }
-
-        return result;
     }
-    
+
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/failover/DefaultOwbFailOverService.java
Thu Sep 13 03:14:28 2012
@@ -36,8 +36,8 @@ import javax.servlet.http.HttpSession;
 
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.logger.WebBeansLoggerFacade;
+import org.apache.webbeans.proxy.javassist.OpenWebBeansClassLoaderProvider;
 import org.apache.webbeans.spi.FailOverService;
-import org.apache.webbeans.util.WebBeansUtil;
 
 public class DefaultOwbFailOverService implements FailOverService 
 {
@@ -85,7 +85,7 @@ public class DefaultOwbFailOverService i
         }
         if (isSupportFailOver || isSupportPassivation)
         {
-            WebBeansUtil.initProxyFactoryClassLoaderProvider();
+            OpenWebBeansClassLoaderProvider.initProxyFactoryClassLoaderProvider();
             value = WebBeansContext.getInstance().getOpenWebBeansConfiguration().getProperty(OWB_FAILOVER_RESOURCSES_SERIALIZATION_HANDLER);
             try 
             {

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/intercept/RequestScopedBeanInterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/intercept/RequestScopedBeanInterceptorHandler.java?rev=1384195&r1=1384194&r2=1384195&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/intercept/RequestScopedBeanInterceptorHandler.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/intercept/RequestScopedBeanInterceptorHandler.java
Thu Sep 13 03:14:28 2012
@@ -26,7 +26,7 @@ import java.util.HashMap;
 
 
 /**
- * <p>This is a {@link javassist.util.proxy.MethodHandler} especially
+ * <p>This is a {@link org.apache.webbeans.proxy.MethodHandler} especially
  * made for &#064;RequestScoped beans used in web applications.</p>
  * 
  * <p>Since there is only one single contextual instance of an &#064;RequestScoped
bean per thread,



Mime
View raw message