camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1327494 - in /camel/branches/camel-2.9.x: ./ camel-core/src/main/java/org/apache/camel/language/bean/ camel-core/src/test/java/org/apache/camel/processor/
Date Wed, 18 Apr 2012 13:00:33 GMT
Author: davsclaus
Date: Wed Apr 18 13:00:33 2012
New Revision: 1327494

URL: http://svn.apache.org/viewvc?rev=1327494&view=rev
Log:
CAMEL-5189: method call expression should propagate exchange properties and message headers,
so we can support stateful EIPs such as dynamic router etc. This is also consistent what we
do in with other EIPs and components.

Added:
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterExchangeHeadersTest.java
      - copied unchanged from r1327493, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterExchangeHeadersTest.java
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterExchangePropertiesTest.java
      - copied unchanged from r1327493, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterExchangePropertiesTest.java
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1327493

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

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java?rev=1327494&r1=1327493&r2=1327494&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
Wed Apr 18 13:00:33 2012
@@ -162,6 +162,14 @@ public class BeanExpression implements E
                 processor.process(resultExchange);
                 result = resultExchange.getOut().getBody();
 
+                // propagate properties and headers from result
+                if (resultExchange.hasProperties()) {
+                    exchange.getProperties().putAll(resultExchange.getProperties());
+                }
+                if (resultExchange.getOut().hasHeaders()) {
+                    exchange.getIn().getHeaders().putAll(resultExchange.getOut().getHeaders());
+                }
+
                 // propagate exceptions
                 if (resultExchange.getException() != null) {
                     exchange.setException(resultExchange.getException());



Mime
View raw message