camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1101481 - in /camel/trunk/camel-core/src/main/java/org/apache/camel/model: MulticastDefinition.java RecipientListDefinition.java SplitDefinition.java
Date Tue, 10 May 2011 14:40:34 GMT
Author: davsclaus
Date: Tue May 10 14:40:33 2011
New Revision: 1101481

URL: http://svn.apache.org/viewvc?rev=1101481&view=rev
Log:
Fixed camel model getTimeout returning null instead of 0 if timeout has not been set.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java?rev=1101481&r1=1101480&r2=1101481&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java Tue
May 10 14:40:33 2011
@@ -202,7 +202,8 @@ public class MulticastDefinition extends
             // we are running in parallel so create a cached thread pool which grows/shrinks
automatic
             executorService = routeContext.getCamelContext().getExecutorServiceStrategy().newDefaultThreadPool(this,
"Multicast");
         }
-        if (getTimeout() > 0 && !isParallelProcessing()) {
+        long timeout = getTimeout() != null ? getTimeout() : 0;
+        if (timeout > 0 && !isParallelProcessing()) {
             throw new IllegalArgumentException("Timeout is used but ParallelProcessing has
not been enabled.");
         }
         if (onPrepareRef != null) {
@@ -210,7 +211,7 @@ public class MulticastDefinition extends
         }
 
         return new MulticastProcessor(routeContext.getCamelContext(), list, aggregationStrategy,
isParallelProcessing(),
-                                      executorService, isStreaming(), isStopOnException(),
getTimeout(), onPrepare);
+                                      executorService, isStreaming(), isStopOnException(),
timeout, onPrepare);
     }
 
     public AggregationStrategy getAggregationStrategy() {
@@ -283,7 +284,7 @@ public class MulticastDefinition extends
     }
 
     public Long getTimeout() {
-        return timeout != null ? timeout : 0;
+        return timeout;
     }
 
     public void setTimeout(Long timeout) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java?rev=1101481&r1=1101480&r2=1101481&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
Tue May 10 14:40:33 2011
@@ -121,7 +121,8 @@ public class RecipientListDefinition<Typ
             executorService = routeContext.getCamelContext().getExecutorServiceStrategy().newDefaultThreadPool(this,
"RecipientList");
         }
         answer.setExecutorService(executorService);
-        if (getTimeout() > 0 && !isParallelProcessing()) {
+        long timeout = getTimeout() != null ? getTimeout() : 0;
+        if (timeout > 0 && !isParallelProcessing()) {
             throw new IllegalArgumentException("Timeout is used but ParallelProcessing has
not been enabled.");
         }
 
@@ -358,7 +359,7 @@ public class RecipientListDefinition<Typ
     }
 
     public Long getTimeout() {
-        return timeout != null ? timeout : 0;
+        return timeout;
     }
 
     public void setTimeout(Long timeout) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java?rev=1101481&r1=1101480&r2=1101481&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/SplitDefinition.java Tue May
10 14:40:33 2011
@@ -99,7 +99,8 @@ public class SplitDefinition extends Exp
             // we are running in parallel so create a cached thread pool which grows/shrinks
automatic
             executorService = routeContext.getCamelContext().getExecutorServiceStrategy().newDefaultThreadPool(this,
"Split");
         }
-        if (getTimeout() > 0 && !isParallelProcessing()) {
+        long timeout = getTimeout() != null ? getTimeout() : 0;
+        if (timeout > 0 && !isParallelProcessing()) {
             throw new IllegalArgumentException("Timeout is used but ParallelProcessing has
not been enabled.");
         }
         if (onPrepareRef != null) {
@@ -108,7 +109,7 @@ public class SplitDefinition extends Exp
 
         Expression exp = getExpression().createExpression(routeContext);
         return new Splitter(routeContext.getCamelContext(), exp, childProcessor, aggregationStrategy,
-                            isParallelProcessing(), executorService, isStreaming(), isStopOnException(),
getTimeout(), onPrepare);
+                            isParallelProcessing(), executorService, isStreaming(), isStopOnException(),
timeout, onPrepare);
     }
 
     



Mime
View raw message