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 2012/06/18 10:48:32 UTC

svn commit: r1351241 - in /camel/branches/camel-2.9.x: ./ camel-core/src/main/java/org/apache/camel/processor/aggregate/ camel-core/src/test/java/org/apache/camel/processor/aggregator/

Author: davsclaus
Date: Mon Jun 18 08:48:31 2012
New Revision: 1351241

URL: http://svn.apache.org/viewvc?rev=1351241&view=rev
Log:
CAMEL-5375: Added CompletionAwareAggregationStrategy to aggregate EIP to allow callback when the aggregated exchnge is complete.

Added:
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/aggregate/CompletionAwareAggregationStrategy.java
      - copied unchanged from r1351237, camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/CompletionAwareAggregationStrategy.java
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompletionAwareAggregationStrategyTest.java
      - copied unchanged from r1351237, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompletionAwareAggregationStrategyTest.java
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java

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

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/processor/aggregate/AggregateProcessor.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java?rev=1351241&r1=1351240&r2=1351241&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/aggregate/AggregateProcessor.java Mon Jun 18 08:48:31 2012
@@ -404,7 +404,12 @@ public class AggregateProcessor extends 
         // add this as in progress before we submit the task
         inProgressCompleteExchanges.add(exchange.getExchangeId());
 
-        // send this exchange
+        // invoke the on completion callback
+        if (aggregationStrategy instanceof CompletionAwareAggregationStrategy) {
+            ((CompletionAwareAggregationStrategy) aggregationStrategy).onCompletion(exchange);
+        }
+
+            // send this exchange
         executorService.submit(new Runnable() {
             public void run() {
                 LOG.debug("Processing aggregated exchange: {}", exchange);