geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r814384 - /geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
Date Sun, 13 Sep 2009 21:22:35 GMT
Author: kevan
Date: Sun Sep 13 21:22:34 2009
New Revision: 814384

URL: http://svn.apache.org/viewvc?rev=814384&view=rev
Log:
GERONIMO-4868 always reset the CGLIB callback during createProxy() call. Otherwise, a ThreadLocal
can prevent undeployed application ClassLoaders from being GCed. Not totally tested, yet...

Modified:
    geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java?rev=814384&r1=814383&r2=814384&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
Sun Sep 13 21:22:34 2009
@@ -208,22 +208,24 @@
 
             Callback callback = getMethodInterceptor(proxyType, kernel, target);
 
-            Enhancer.registerCallbacks(proxyType, new Callback[]{callback});
             try {
+                Enhancer.registerCallbacks(proxyType, new Callback[]{callback});
                 Object proxy = fastClass.newInstance();
                 interceptors.put(proxy, callback);
                 return proxy;
             } catch (InvocationTargetException e) {
                 Throwable cause = e.getCause();
                 if (cause instanceof RuntimeException) {
-                  throw (RuntimeException) cause;
+                    throw (RuntimeException) cause;
                 } else  if (cause instanceof Error) {
-                  throw (Error) cause;
+                    throw (Error) cause;
                 } else if (cause != null) {
-                  throw new ProxyCreationException(cause);
+                    throw new ProxyCreationException(cause);
                 } else {
-                  throw new ProxyCreationException(e);
+                    throw new ProxyCreationException(e);
                 }
+            } finally {
+                Enhancer.registerCallbacks(proxyType, null);
             }
         }
     }



Mime
View raw message