camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1055309 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
Date Wed, 05 Jan 2011 06:38:01 GMT
Author: davsclaus
Date: Wed Jan  5 06:38:01 2011
New Revision: 1055309

URL: http://svn.apache.org/viewvc?rev=1055309&view=rev
Log:
CAMEL-3493: synchronized when adding or removing route definitions, to avoid concurrency issues
if doing this from multiple threads

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.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=1055309&r1=1055308&r2=1055309&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 Wed
Jan  5 06:38:01 2011
@@ -640,7 +640,7 @@ public class DefaultCamelContext extends
         return answer;
     }
 
-    public void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws
Exception {
+    public synchronized void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
throws Exception {
         for (RouteDefinition routeDefinition : routeDefinitions) {
             removeRouteDefinition(routeDefinition);
         }
@@ -672,14 +672,14 @@ public class DefaultCamelContext extends
         return answer;
     }
 
-    public void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
throws Exception {
+    public synchronized void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
throws Exception {
         this.routeDefinitions.removeAll(routeDefinitions);
         for (RouteDefinition routeDefinition : routeDefinitions) {
             removeRouteDefinition(routeDefinition);
         }
     }
 
-    public void removeRouteDefinition(RouteDefinition routeDefinition) throws Exception {
+    public synchronized void removeRouteDefinition(RouteDefinition routeDefinition) throws
Exception {
         String id = routeDefinition.idOrCreate(nodeIdFactory);
         stopRoute(id);
         removeRoute(id);



Mime
View raw message