activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r524043 - /activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
Date Fri, 30 Mar 2007 10:55:52 GMT
Author: jstrachan
Date: Fri Mar 30 03:55:50 2007
New Revision: 524043

URL: http://svn.apache.org/viewvc?view=rev&rev=524043
Log:
added some synchronization in case folks use a producer concurrently

Modified:
    activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java

Modified: activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java?view=diff&rev=524043&r1=524042&r2=524043
==============================================================================
--- activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
(original)
+++ activemq/camel/trunk/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java
Fri Mar 30 03:55:50 2007
@@ -44,7 +44,6 @@
     private Conduit conduit;
     private ResultFuture future = new ResultFuture();
 
-
     public CxfProducer(CxfEndpoint endpoint, LocalTransportFactory transportFactory) {
         super(endpoint);
         this.endpoint = endpoint;
@@ -59,15 +58,17 @@
             e.setInMessage(m);
             m.put(LocalConduit.DIRECT_DISPATCH, Boolean.TRUE);
             m.setDestination(destination);
-            conduit.send(m);
+            synchronized (conduit) {
+                conduit.send(m);
 
-            // now lets wait for the response
-            if (endpoint.isInOut()) {
-                Message response = future.getResponse();
-
-                // TODO - why do we need to ignore the returned message and get the out message
from the exchange!
-                response = e.getOutMessage();
-                binding.storeCxfResponse(exchange, response);
+                // now lets wait for the response
+                if (endpoint.isInOut()) {
+                    Message response = future.getResponse();
+
+                    // TODO - why do we need to ignore the returned message and get the out
message from the exchange!
+                    response = e.getOutMessage();
+                    binding.storeCxfResponse(exchange, response);
+                }
             }
         }
         catch (IOException e) {
@@ -93,7 +94,6 @@
         if (conduit != null) {
             conduit.close();
         }
-
     }
 
     protected class ResultFuture implements MessageObserver {



Mime
View raw message