cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5860] Using ProxyClassLoader to create ThreadLocalProxy based proxy
Date Tue, 08 Jul 2014 12:05:31 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes ee8f8ad0a -> e38d311fe


[CXF-5860] Using ProxyClassLoader to create ThreadLocalProxy based proxy


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e38d311f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e38d311f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e38d311f

Branch: refs/heads/2.7.x-fixes
Commit: e38d311fe3ae584f6860c915ea894f9fb215fc86
Parents: ee8f8ad
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Jul 8 13:01:30 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Jul 8 13:04:44 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e38d311f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
index f3c8d6c..cc11ddc 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
@@ -71,6 +71,7 @@ import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.ClassHelper;
 import org.apache.cxf.common.util.PrimitiveUtils;
+import org.apache.cxf.common.util.ProxyClassLoader;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.jaxrs.ext.MessageContext;
@@ -962,7 +963,10 @@ public final class InjectionUtils {
             proxy = createThreadLocalServletApiContext(type.getName());  
         }
         if (proxy == null) {
-            return (ThreadLocalProxy<T>)Proxy.newProxyInstance(type.getClassLoader(),
+            ProxyClassLoader loader = new ProxyClassLoader(Proxy.class.getClassLoader());
+            loader.addLoader(type.getClassLoader());
+            loader.addLoader(ThreadLocalProxy.class.getClassLoader());
+            return (ThreadLocalProxy<T>)Proxy.newProxyInstance(loader,
                                    new Class[] {type, ThreadLocalProxy.class },
                                    new ThreadLocalInvocationHandler<T>());
         }


Mime
View raw message