cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1100921 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
Date Mon, 09 May 2011 08:54:00 GMT
Author: ffang
Date: Mon May  9 08:54:00 2011
New Revision: 1100921

URL: http://svn.apache.org/viewvc?rev=1100921&view=rev
Log:
[CXF-3503]CXF should set the TCCL to the one of the service being invoked prior any invocation

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java?rev=1100921&r1=1100920&r2=1100921&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java Mon
May  9 08:54:00 2011
@@ -80,7 +80,9 @@ public abstract class AbstractInvoker im
 
     protected Object invoke(Exchange exchange, final Object serviceObject, Method m, List<Object>
params) {
         Object res;
+        ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
         try {
+            Thread.currentThread().setContextClassLoader(serviceObject.getClass().getClassLoader());
             Object[] paramArray = new Object[]{};
             if (params != null) {
                 paramArray = params.toArray();
@@ -131,6 +133,8 @@ public abstract class AbstractInvoker im
             checkSuspendedInvocation(exchange, serviceObject, m, params, e);
             exchange.getInMessage().put(FaultMode.class, FaultMode.UNCHECKED_APPLICATION_FAULT);
             throw createFault(e, m, params, false);
+        } finally {
+            Thread.currentThread().setContextClassLoader(oldCL);
         }
     }
     



Mime
View raw message