cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r471790 - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/endpoint/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ rt/ws/addr/src/main/java/org/apache/cxf...
Date Mon, 06 Nov 2006 16:50:22 GMT
Author: eglynn
Date: Mon Nov  6 08:50:21 2006
New Revision: 471790

URL: http://svn.apache.org/viewvc?view=rev&rev=471790
Log:
Fix for race condition around full responses overtaking partial responses
so that the exchange in message is intermittently over-written.

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?view=diff&rev=471790&r1=471789&r2=471790
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Mon
Nov  6 08:50:21 2006
@@ -232,6 +232,7 @@
             synchronized (message.getExchange()) {
                 if (!isPartialResponse(message)) {
                     message.getExchange().put(FINISHED, Boolean.TRUE);
+                    message.getExchange().setInMessage(message);
                     message.getExchange().notifyAll();
                 }
             }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=471790&r1=471789&r2=471790
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Mon Nov  6 08:50:21 2006
@@ -565,7 +565,7 @@
             InputStream responseStream = req.getInputStream();
             Message inMessage = new MessageImpl();
             // disposable exchange, swapped with real Exchange on correlation
-            new ExchangeImpl().setInMessage(inMessage);
+            inMessage.setExchange(new ExchangeImpl());
             // REVISIT: how to get response headers?
             //inMessage.put(Message.PROTOCOL_HEADERS, req.getXXX());
             setHeaders(inMessage);

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?view=diff&rev=471790&r1=471789&r2=471790
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
(original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
Mon Nov  6 08:50:21 2006
@@ -348,7 +348,9 @@
                     
                     partialResponse.getInterceptorChain().reset();
                     exchange.setConduit(null);
-                    exchange.setOutMessage(fullResponse);
+                    if (fullResponse != null) {
+                        exchange.setOutMessage(fullResponse);
+                    }
                 }
             } catch (Exception e) {
                 LOG.log(Level.WARNING, "SERVER_TRANSPORT_REBASE_FAILURE_MSG", e);

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java?view=diff&rev=471790&r1=471789&r2=471790
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
(original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
Mon Nov  6 08:50:21 2006
@@ -454,7 +454,7 @@
                 uncorrelatedExchanges.get(maps.getRelatesTo().getValue());
             if (correlatedExchange != null) {
                 synchronized (correlatedExchange) {
-                    correlatedExchange.setInMessage(message);
+                    message.setExchange(correlatedExchange);
                 }
             }
         }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java?view=diff&rev=471790&r1=471789&r2=471790
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/HeaderVerifier.java
Mon Nov  6 08:50:21 2006
@@ -66,15 +66,19 @@
     }
 
     public void handleMessage(SoapMessage message) {
+        mediate(message);
+    }
+
+    public void handleFault(SoapMessage message) {
+        mediate(message);
+    }
+    
+    private void mediate(SoapMessage message) {
         boolean outgoingPartialResponse = isOutgoingPartialResponse(message);
         if (outgoingPartialResponse) {
             addPartialResponseHeader(message);
         }
         verify(message, outgoingPartialResponse);
-    }
-
-    public void handleFault(SoapMessage message) {
-        verify(message, isOutgoingPartialResponse(message));
     }
 
     private void addPartialResponseHeader(SoapMessage message) {



Mime
View raw message