You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/09/22 18:36:32 UTC

svn commit: r1174248 - in /camel/branches/camel-2.8.x: ./ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/processor/

Author: davsclaus
Date: Thu Sep 22 16:36:31 2011
New Revision: 1174248

URL: http://svn.apache.org/viewvc?rev=1174248&view=rev
Log:
Merged revisions 1174245 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk


Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 22 16:36:31 2011
@@ -1 +1 @@
-/camel/trunk:1173732,1173958,1174047,1174129
+/camel/trunk:1173732,1173958,1174047,1174129,1174245

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?rev=1174248&r1=1174247&r2=1174248&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Thu Sep 22 16:36:31 2011
@@ -328,7 +328,12 @@ public final class DefaultExchange imple
     }
 
     public boolean isTransacted() {
-        return getUnitOfWork() != null && getUnitOfWork().isTransacted();
+        UnitOfWork uow = getUnitOfWork();
+        if (uow != null) {
+            return uow.isTransacted();
+        } else {
+            return false;
+        }
     }
 
     public boolean isRollbackOnly() {

Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java?rev=1174248&r1=1174247&r2=1174248&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/DefaultChannel.java Thu Sep 22 16:36:31 2011
@@ -39,6 +39,7 @@ import org.apache.camel.processor.interc
 import org.apache.camel.spi.InterceptStrategy;
 import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.spi.RouteContext;
+import org.apache.camel.spi.UnitOfWork;
 import org.apache.camel.util.AsyncProcessorHelper;
 import org.apache.camel.util.OrderedComparator;
 import org.apache.camel.util.ServiceHelper;
@@ -304,11 +305,17 @@ public class DefaultChannel extends Serv
         AsyncProcessor async = AsyncProcessorTypeConverter.convert(processor);
         boolean sync = async.process(exchange, new AsyncCallback() {
             public void done(boolean doneSync) {
-                // pop the route context we just used
-                if (exchange.getUnitOfWork() != null) {
-                    exchange.getUnitOfWork().popRouteContext();
+                try {
+                    UnitOfWork uow = exchange.getUnitOfWork();
+                    // pop the route context we just used
+                    if (uow != null) {
+                        uow.popRouteContext();
+                    }
+                } catch (Exception e) {
+                    exchange.setException(e);
+                } finally {
+                    callback.done(doneSync);
                 }
-                callback.done(doneSync);
             }
         });
 

Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java?rev=1174248&r1=1174247&r2=1174248&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java Thu Sep 22 16:36:31 2011
@@ -152,19 +152,23 @@ public class UnitOfWorkProcessor extends
     private void doneUow(UnitOfWork uow, Exchange exchange) {
         // unit of work is done
         try {
-            if (exchange.getUnitOfWork() != null) {
-                exchange.getUnitOfWork().done(exchange);
+            if (uow != null) {
+                uow.done(exchange);
             }
         } catch (Throwable e) {
             LOG.warn("Exception occurred during done UnitOfWork for Exchange: " + exchange
                     + ". This exception will be ignored.", e);
         }
         try {
-            uow.stop();
+            if (uow != null) {
+                uow.stop();
+            }
         } catch (Throwable e) {
             LOG.warn("Exception occurred during stopping UnitOfWork for Exchange: " + exchange
                     + ". This exception will be ignored.", e);
         }
+
+        // remove uow from exchange as its done
         exchange.setUnitOfWork(null);
     }