camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1221738 - in /camel/branches/camel-2.8.x: ./ camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java camel-core/src/test/java/org/apache/camel/component/seda/SedaFromRouteIdTest.java
Date Wed, 21 Dec 2011 14:17:51 GMT
Author: davsclaus
Date: Wed Dec 21 14:17:51 2011
New Revision: 1221738

URL: http://svn.apache.org/viewvc?rev=1221738&view=rev
Log:
CAMEL-4806: Added strategy method in seda consumer to allow custom preparation for exchange.

Added:
    camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/component/seda/SedaFromRouteIdTest.java
      - copied unchanged from r1221737, camel/trunk/camel-core/src/test/java/org/apache/camel/component/seda/SedaFromRouteIdTest.java
Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Dec 21 14:17:51 2011
@@ -1 +1 @@
-/camel/trunk:1202148,1202167,1202204-1202206,1202214-1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743,1207784,1208301,1208930,1208964-1208965,1209006-1209007,1209382,1209401,1209477,1209845-1209846,1210113,1210391,1210771,1210830,1211363,1211414,1211773,1211811,1212275-1212276,1212408,1213197,1213219,1213232,1213526,1214132,1214639,1214743,1215240,1215448,1215482,1220711,1221129,1221566
+/camel/trunk:1202148,1202167,1202204-1202206,1202214-1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743,1207784,1208301,1208930,1208964-1208965,1209006-1209007,1209382,1209401,1209477,1209845-1209846,1210113,1210391,1210771,1210830,1211363,1211414,1211773,1211811,1212275-1212276,1212408,1213197,1213219,1213232,1213526,1214132,1214639,1214743,1215240,1215448,1215482,1220711,1221129,1221566,1221737

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/component/seda/SedaConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java?rev=1221738&r1=1221737&r2=1221738&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
(original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
Wed Dec 21 14:17:51 2011
@@ -155,9 +155,8 @@ public class SedaConsumer extends Servic
                 if (exchange != null) {
                     try {
                         // send a new copied exchange with new camel context
-                        Exchange newExchange = ExchangeHelper.copyExchangeAndSetCamelContext(exchange,
endpoint.getCamelContext());
-                        // set the fromEndpoint 
-                        newExchange.setFromEndpoint(endpoint);
+                        Exchange newExchange = prepareExchange(exchange);
+                        // process the exchange
                         sendToConsumers(newExchange);
                         // copy the message back
                         if (newExchange.hasOut()) {
@@ -195,6 +194,20 @@ public class SedaConsumer extends Servic
     }
 
     /**
+     * Strategy to prepare exchange for being processed by this consumer
+     *
+     * @param exchange the exchange
+     * @return the exchange to process by this consumer.
+     */
+    protected Exchange prepareExchange(Exchange exchange) {
+        // send a new copied exchange with new camel context
+        Exchange newExchange = ExchangeHelper.copyExchangeAndSetCamelContext(exchange, endpoint.getCamelContext());
+        // set the from endpoint
+        newExchange.setFromEndpoint(endpoint);
+        return newExchange;
+    }
+
+    /**
      * Send the given {@link Exchange} to the consumer(s).
      * <p/>
      * If multiple consumers then they will each receive a copy of the Exchange.



Mime
View raw message