CAMEL-9196: Timeout must be a positive value when calling stop route with a 
timeout value.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9e7516e7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9e7516e7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9e7516e7

Branch: refs/heads/camel-2.16.x
Commit: 9e7516e7a4b34803ba517f8435f0b6208c0589a1
Parents: 63437c6
Author: Claus Ibsen <davscl...@apache.org>
Authored: Wed Oct 7 07:15:36 2015 +0200
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Thu Oct 8 11:26:28 2015 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/impl/DefaultShutdownStrategy.java     | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9e7516e7/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java 
b/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
index 0657f15..2eac21e 100644
--- 
a/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
+++ 
b/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
@@ -166,6 +166,11 @@ public class DefaultShutdownStrategy extends 
ServiceSupport implements ShutdownS
     protected boolean doShutdown(CamelContext context, List<RouteStartupOrder> 
routes, long timeout, TimeUnit timeUnit,
                                  boolean suspendOnly, boolean 
abortAfterTimeout, boolean forceShutdown) throws Exception {
 
+        // timeout must be a positive value
+        if (timeout <= 0) {
+            throw new IllegalArgumentException("Timeout must be a positive 
value");
+        }
+
         // just return if no routes to shutdown
         if (routes.isEmpty()) {
             return true;

Reply via email to