You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/07/29 14:28:14 UTC

svn commit: r980423 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java

Author: davsclaus
Date: Thu Jul 29 12:28:14 2010
New Revision: 980423

URL: http://svn.apache.org/viewvc?rev=980423&view=rev
Log:
CAMEL-3012,CAMEL-3001: start should re-create route definitions (cold start).

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java

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=980423&r1=980422&r2=980423&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 Thu Jul 29 12:28:14 2010
@@ -122,7 +122,6 @@ public class DefaultCamelContext extends
     private static final String NAME_PREFIX = "camel-";
     private static final AtomicInteger CONTEXT_COUNTER = new AtomicInteger(0);
     private ClassLoader applicationContextClassLoader;
-    private final AtomicBoolean routeDefinitionInitiated = new AtomicBoolean(false);
     private String name;
     private final Map<String, Endpoint> endpoints = new EndpointRegistry();
     private final AtomicInteger endpointKeyCounter = new AtomicInteger();
@@ -1197,11 +1196,8 @@ public class DefaultCamelContext extends
 
         startServices(components.values());
 
-        // the route definitions is only started once, even if Camel is stopped
-        if (routeDefinitionInitiated.compareAndSet(false, true)) {
-            // TODO: we should re-create route defs on start, people should use suspend/resume for hot restart
-            startRouteDefinitions(routeDefinitions);
-        }
+        // start the route definitions before the routes is started
+        startRouteDefinitions(routeDefinitions);
 
         // start routes
         doStartRoutes(routeServices, true);

Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java?rev=980423&r1=980422&r2=980423&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java (original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/cxfbean/CxfBeanTest.java Thu Jul 29 12:28:14 2010
@@ -70,7 +70,6 @@ public class CxfBeanTest extends Abstrac
     }
 
     @Test
-    @Ignore("There is a bug in CxfRsComponent when restarting using stop/start")
     public void testGetConsumerAfterReStartCamelContext() throws Exception {
         URL url = new URL("http://localhost:9000/customerservice/customers/123");