tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r982475 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java
Date Thu, 05 Aug 2010 05:36:27 GMT
Author: djencks
Date: Thu Aug  5 05:36:27 2010
New Revision: 982475

URL: http://svn.apache.org/viewvc?rev=982475&view=rev
Log:
OPENEJB-1321 attach the generated proxy to the classloader of the original class

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java?rev=982475&r1=982474&r2=982475&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java
Thu Aug  5 05:36:27 2010
@@ -16,14 +16,17 @@
  */
 package org.apache.openejb.util.proxy;
 
-import org.apache.xbean.asm.*;
-
-import java.lang.reflect.Method;
 import java.lang.reflect.Field;
-import java.net.URLClassLoader;
+import java.lang.reflect.Method;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
+import org.apache.xbean.asm.ClassWriter;
+import org.apache.xbean.asm.FieldVisitor;
+import org.apache.xbean.asm.Label;
+import org.apache.xbean.asm.MethodVisitor;
+import org.apache.xbean.asm.Opcodes;
+import org.apache.xbean.asm.Type;
 
 public class LocalBeanProxyGeneratorImpl implements LocalBeanProxyGenerator, Opcodes {
 
@@ -62,7 +65,7 @@ public class LocalBeanProxyGeneratorImpl
 
         try {
             byte[] proxyBytes = generateProxy(clsToProxy, clsName);
-            return (Class<?>) unsafe.defineClass(proxyName, proxyBytes, 0, proxyBytes.length,
cl, this.getClass().getProtectionDomain());
+            return (Class<?>) unsafe.defineClass(proxyName, proxyBytes, 0, proxyBytes.length,
clsToProxy.getClassLoader(), clsToProxy.getProtectionDomain());
         } catch (ProxyGenerationException e) {
             throw new InternalError(e.toString());
         }



Mime
View raw message