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 2020/12/14 08:22:33 UTC

[camel] 01/02: CAMEL-15930: ClusteredRouteController cannot start clustered routes

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 43d3c32077b7e8bbd04a46d28ccf128483ca8e57
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 12 11:58:02 2020 +0100

    CAMEL-15930: ClusteredRouteController cannot start clustered routes
---
 .../impl/cluster/ClusteredRouteController.java     | 78 +---------------------
 1 file changed, 3 insertions(+), 75 deletions(-)

diff --git a/core/camel-cluster/src/main/java/org/apache/camel/impl/cluster/ClusteredRouteController.java b/core/camel-cluster/src/main/java/org/apache/camel/impl/cluster/ClusteredRouteController.java
index 5811a3d..84462c9 100644
--- a/core/camel-cluster/src/main/java/org/apache/camel/impl/cluster/ClusteredRouteController.java
+++ b/core/camel-cluster/src/main/java/org/apache/camel/impl/cluster/ClusteredRouteController.java
@@ -27,11 +27,9 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.Experimental;
 import org.apache.camel.NamedNode;
 import org.apache.camel.Route;
 import org.apache.camel.RuntimeCamelException;
@@ -47,7 +45,9 @@ import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Experimental
+/**
+ * Clustered {@link org.apache.camel.spi.RouteController}.
+ */
 public class ClusteredRouteController extends DefaultRouteController {
     private static final Logger LOGGER = LoggerFactory.getLogger(ClusteredRouteController.class);
 
@@ -215,78 +215,6 @@ public class ClusteredRouteController extends DefaultRouteController {
     }
 
     // *******************************
-    // Route operations are disabled
-    // *******************************
-
-    @Override
-    public void startRoute(String routeId) throws Exception {
-        failIfClustered(routeId);
-
-        // Delegate to default impl.
-        super.startRoute(routeId);
-    }
-
-    @Override
-    public void stopRoute(String routeId) throws Exception {
-        failIfClustered(routeId);
-
-        // Delegate to default impl.
-        super.stopRoute(routeId);
-    }
-
-    @Override
-    public void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception {
-        failIfClustered(routeId);
-
-        // Delegate to default impl.
-        super.stopRoute(routeId, timeout, timeUnit);
-    }
-
-    @Override
-    public boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception {
-        failIfClustered(routeId);
-
-        // Delegate to default impl.
-        return super.stopRoute(routeId, timeout, timeUnit, abortAfterTimeout);
-    }
-
-    @Override
-    public void suspendRoute(String routeId) throws Exception {
-        failIfClustered(routeId);
-
-        // Delegate to default impl.
-        super.suspendRoute(routeId);
-    }
-
-    @Override
-    public void suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception {
-        failIfClustered(routeId);
-
-        // Delegate to default impl.
-        super.suspendRoute(routeId, timeout, timeUnit);
-    }
-
-    @Override
-    public void resumeRoute(String routeId) throws Exception {
-        failIfClustered(routeId);
-
-        // Delegate to default impl.
-        super.resumeRoute(routeId);
-    }
-
-    // *******************************
-    // Helpers
-    // *******************************
-
-    private void failIfClustered(String routeId) {
-        // Can't perform action on routes managed by this controller as they
-        // are clustered and they may be part of the same view.
-        if (routes.contains(routeId)) {
-            throw new UnsupportedOperationException("Operation not supported as route " + routeId + " is clustered");
-        }
-    }
-
-    // *******************************
     // Factories
     // *******************************