cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r667605 - in /cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local: LocalConduit.java LocalDestination.java
Date Fri, 13 Jun 2008 17:53:55 GMT
Author: dkulp
Date: Fri Jun 13 10:53:55 2008
New Revision: 667605

URL: http://svn.apache.org/viewvc?rev=667605&view=rev
Log:
[CXF-1649] Possible fix for some race conditions in the Local transport by copying the map
on the same thread that would be writing to it.

Modified:
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
    cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?rev=667605&r1=667604&r2=667605&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
(original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
Fri Jun 13 10:53:55 2008
@@ -117,14 +117,15 @@
                     final PipedInputStream stream = new PipedInputStream();
                     wrappedStream = new PipedOutputStream(stream);
 
+                    final MessageImpl inMsg = new MessageImpl();
+                    transportFactory.copy(message, inMsg); 
+
+                    inMsg.setContent(InputStream.class, stream);
+                    inMsg.setDestination(destination);
+                    inMsg.put(IN_CONDUIT, conduit);
+
                     final Runnable receiver = new Runnable() {
-                        public void run() {
-                            MessageImpl inMsg = new MessageImpl();
-                            transportFactory.copy(message, inMsg); 
-                            inMsg.setContent(InputStream.class, stream);
-                            inMsg.setDestination(destination);
-                            inMsg.put(IN_CONDUIT, conduit);
-                            
+                        public void run() {                            
                             ExchangeImpl ex = new ExchangeImpl();
                             ex.setInMessage(inMsg);
                             ex.put(IN_EXCHANGE, exchange);

Modified: cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?rev=667605&r1=667604&r2=667605&view=diff
==============================================================================
--- cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
(original)
+++ cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
Fri Jun 13 10:53:55 2008
@@ -84,16 +84,16 @@
                         protected void onFirstWrite() throws IOException {
                             final PipedInputStream stream = new PipedInputStream();
                             wrappedStream = new PipedOutputStream(stream);
-    
+
+                            final MessageImpl m = new MessageImpl();
+                            localDestinationFactory.copy(message, m);
+                            m.setContent(InputStream.class, stream);
+
                             final Runnable receiver = new Runnable() {
-                                public void run() {
-                                    MessageImpl m = new MessageImpl();
-                                    localDestinationFactory.copy(message, m);
-                                    
+                                public void run() {                                    
                                     if (exchange != null) {
                                         exchange.setInMessage(m);
                                     }
-                                    m.setContent(InputStream.class, stream);
                                     conduit.getMessageObserver().onMessage(m);
                                 }
                             };



Mime
View raw message