You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2011/01/14 10:26:57 UTC

svn commit: r1058910 - in /camel/trunk/camel-core/src/main/java/org/apache/camel: CamelContext.java impl/DefaultCamelContext.java spi/ShutdownStrategy.java

Author: ningjiang
Date: Fri Jan 14 09:26:56 2011
New Revision: 1058910

URL: http://svn.apache.org/viewvc?rev=1058910&view=rev
Log:
CAMEL-3240 update the javadoc as Claus suggested.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ShutdownStrategy.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java?rev=1058910&r1=1058909&r2=1058910&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java Fri Jan 14 09:26:56 2011
@@ -427,7 +427,18 @@ public interface CamelContext extends Su
      */
     void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception;
 
-    void stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean giveUp) throws Exception;
+    /**
+     * Stops the given route using {@link org.apache.camel.spi.ShutdownStrategy} with a specified timeout.
+     *
+     * @param routeId the route id
+     * @param timeout  timeout
+     * @param timeUnit the unit to use
+     * @param giveUp should give up after timeout
+     * @return <tt>true</tt> if the route is stopped before the timeout
+     * @throws Exception is thrown if the route could not be stopped for whatever reason
+     * @see #suspendRoute(String, long, java.util.concurrent.TimeUnit)
+     */
+    boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean giveUp) throws Exception;
     
     /**
      * Shutdown and <b>removes</b> the given route using {@link org.apache.camel.spi.ShutdownStrategy}.

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=1058910&r1=1058909&r2=1058910&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Fri Jan 14 09:26:56 2011
@@ -726,7 +726,7 @@ public class DefaultCamelContext extends
         }
     }
 
-    public synchronized void stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean giveUp) throws Exception {
+    public synchronized boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean giveUp) throws Exception {
         RouteService routeService = routeServices.get(routeId);
         if (routeService != null) {
             List<RouteStartupOrder> routes = new ArrayList<RouteStartupOrder>(1);
@@ -739,6 +739,7 @@ public class DefaultCamelContext extends
                 routeService.setRemovingRoutes(false);
                 stopRouteService(routeService);
             }
+            return completed;
         }
     }
     

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ShutdownStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ShutdownStrategy.java?rev=1058910&r1=1058909&r2=1058910&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ShutdownStrategy.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/ShutdownStrategy.java Fri Jan 14 09:26:56 2011
@@ -77,6 +77,7 @@ public interface ShutdownStrategy extend
      * @param timeout   timeout
      * @param timeUnit  the unit to use
      * @param giveUp    should give up after timeout
+     * @return <tt>true</tt> if the route is stopped before the timeout
      * @throws Exception is thrown if error shutting down the consumers, however its preferred to avoid this
      */
     boolean shutdown(CamelContext context, List<RouteStartupOrder> routes, long timeout, TimeUnit timeUnit, boolean giveUp) throws Exception;