servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1401142 - /servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
Date Tue, 23 Oct 2012 02:05:49 GMT
Author: ffang
Date: Tue Oct 23 02:05:49 2012
New Revision: 1401142

URL: http://svn.apache.org/viewvc?rev=1401142&view=rev
Log:
[SMXCOMP-951]refector AsyncBaseLifeCycle to avoid call into processExchangeInTx even the Exchange
has no Transaction property

Modified:
    servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java

Modified: servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java?rev=1401142&r1=1401141&r2=1401142&view=diff
==============================================================================
--- servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
(original)
+++ servicemix/components/trunk/shared-libraries/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
Tue Oct 23 02:05:49 2012
@@ -352,7 +352,11 @@ public class AsyncBaseLifeCycle implemen
                     }
                     executor.execute(new Runnable() {
                         public void run() {
-                            processExchangeInTx(exchange, tx);
+                            if (tx != null) {
+                                processExchangeInTx(exchange, tx);
+                            } else {
+                                processExchangeWithoutTx(exchange);
+                            }
                         }
                     });
                 }
@@ -530,10 +534,17 @@ public class AsyncBaseLifeCycle implemen
     public void onMessageExchange(MessageExchange exchange) {
         if (!container.handleTransactions()) {
             final Transaction tx = (Transaction) exchange.getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME);
-            processExchangeInTx(exchange, tx);
-            return;
+            if (tx != null) {
+                processExchangeInTx(exchange, tx);
+            } else {
+                processExchangeWithoutTx(exchange);
+            }
+        } else {
+            processExchangeWithoutTx(exchange);
         }
+    }
 
+    protected void processExchangeWithoutTx(MessageExchange exchange) {
         ExchangeStatus oldStatus = exchange.getStatus();
         try {
             processExchange(exchange);



Mime
View raw message