camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1056325 - /camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
Date Fri, 07 Jan 2011 14:06:24 GMT
Author: davsclaus
Date: Fri Jan  7 14:06:24 2011
New Revision: 1056325

URL: http://svn.apache.org/viewvc?rev=1056325&view=rev
Log:
CAMEL-3497: Cancelling future tasks is now done using a running boolean instead of a keeping
a big array list with the future references.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java?rev=1056325&r1=1056324&r2=1056325&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
Fri Jan  7 14:06:24 2011
@@ -226,7 +226,6 @@ public class MulticastProcessor extends 
 
         final AtomicInteger total = new AtomicInteger(0);
 
-        final List<Future<Exchange>> tasks = new ArrayList<Future<Exchange>>();
         final Iterator<ProcessorExchangePair> it = pairs.iterator();
         while (it.hasNext()) {
             final ProcessorExchangePair pair = it.next();
@@ -263,7 +262,6 @@ public class MulticastProcessor extends 
                     return subExchange;
                 }
             });
-            tasks.add(task);
 
             total.incrementAndGet();
         }
@@ -338,15 +336,13 @@ public class MulticastProcessor extends 
 
         if (timedOut || stoppedOnException) {
             if (timedOut && LOG.isDebugEnabled()) {
-                LOG.debug("Cancelling future tasks due timeout after " + timeout + " millis.");
+                LOG.debug("Cancelling tasks due timeout after " + timeout + " millis.");
             }
             if (stoppedOnException && LOG.isDebugEnabled()) {
-                LOG.debug("Cancelling future tasks due stopOnException.");
+                LOG.debug("Cancelling tasks due stopOnException.");
             }
             // cancel tasks as we timed out (its safe to cancel done tasks)
-            for (Future future : tasks) {
-                future.cancel(true);
-            }
+            running.set(false);
         }
 
         if (LOG.isDebugEnabled()) {



Mime
View raw message