Author: akarpe
Date: Fri Sep 24 18:15:52 2010
New Revision: 1001004

URL: http://svn.apache.org/viewvc?rev=1001004&view=rev
Log:
Added an API to RoutePolicySupport for stopRoute to control timeout for 
graceful shutdown

Modified:
    
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java?rev=1001004&r1=1001003&r2=1001004&view=diff
==============================================================================
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/RoutePolicySupport.java
 Fri Sep 24 18:15:52 2010
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.impl;
 
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.Consumer;
 import org.apache.camel.Exchange;
 import org.apache.camel.Route;
@@ -71,6 +73,10 @@ public abstract class RoutePolicySupport
         route.getRouteContext().getCamelContext().stopRoute(route.getId());
     }
 
+    protected void stopRoute(Route route, long timeout, TimeUnit timeUnit) 
throws Exception {
+        route.getRouteContext().getCamelContext().stopRoute(route.getId(), 
timeout, timeUnit);
+    }
+    
     /**
      * Handles the given exception using the {...@link #getExceptionHandler()}
      *


Reply via email to