cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r538255 - /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
Date Tue, 15 May 2007 17:07:03 GMT
Author: gawor
Date: Tue May 15 10:07:02 2007
New Revision: 538255

URL: http://svn.apache.org/viewvc?view=rev&rev=538255
Log:
switch request context to be associated with the proxy instance. see the dev list for discusson
on this issue.

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java?view=diff&rev=538255&r1=538254&r2=538255
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JaxWsClientProxy.java
Tue May 15 10:07:02 2007
@@ -22,6 +22,7 @@
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.net.HttpURLConnection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -59,8 +60,9 @@
 
     private static final Logger LOG = LogUtils.getL7dLogger(JaxWsClientProxy.class);
 
-    protected ThreadLocal <Map<String, Object>> requestContext = 
-            new ThreadLocal<Map<String, Object>>();
+    protected Map<String, Object> requestContext =
+            Collections.synchronizedMap(new HashMap<String, Object>());
+
     protected ThreadLocal <Map<String, Object>> responseContext =
             new ThreadLocal<Map<String, Object>>();
 
@@ -103,7 +105,8 @@
         if (null == params) {
             params = new Object[0];
         }
-        Map<String, Object> reqContext = new HashMap<String, Object>(this.getRequestContext());
       
+
+        Map<String, Object> reqContext = this.getRequestContextCopy();        
         Map<String, Object> respContext = this.getResponseContext();
         
         // Clear the response context's hold information
@@ -198,11 +201,14 @@
     }
 
 
-    public Map<String, Object> getRequestContext() {
-        if (null == requestContext.get()) {
-            requestContext.set(new HashMap<String, Object>());
+    private Map<String, Object> getRequestContextCopy() {
+        synchronized (this.requestContext) {
+            return new HashMap<String, Object>(this.requestContext);
         }
-        return requestContext.get();
+    }
+    
+    public Map<String, Object> getRequestContext() {
+        return requestContext;
     }
 
     public Map<String, Object> getResponseContext() {



Mime
View raw message