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 2019/04/17 15:19:47 UTC

[camel] branch master updated: CAMEL-13118: Components should not depend on camel-core but camel-support

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


The following commit(s) were added to refs/heads/master by this push:
     new efa5dba  CAMEL-13118: Components should not depend on camel-core but camel-support
efa5dba is described below

commit efa5dba78029beb94156a4c56db1cd4d4f5552ea
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Apr 17 17:15:09 2019 +0200

    CAMEL-13118: Components should not depend on camel-core but camel-support
---
 components/camel-infinispan/pom.xml                    |  2 +-
 .../infinispan/policy/InfinispanRoutePolicy.java       |  4 +---
 .../src/test/resources/log4j2.properties               |  2 +-
 .../main/java/org/apache/camel/spi/RouteContext.java   | 18 ++++++++++++++++++
 4 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/components/camel-infinispan/pom.xml b/components/camel-infinispan/pom.xml
index 7b60894..e4b882a 100644
--- a/components/camel-infinispan/pom.xml
+++ b/components/camel-infinispan/pom.xml
@@ -40,7 +40,7 @@
         <!-- TODO: requires camel-core -->
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-core</artifactId>
+            <artifactId>camel-support</artifactId>
         </dependency>
         <dependency>
             <groupId>org.infinispan</groupId>
diff --git a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java
index acc207d..c3f092f 100644
--- a/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java
+++ b/components/camel-infinispan/src/main/java/org/apache/camel/component/infinispan/policy/InfinispanRoutePolicy.java
@@ -33,7 +33,6 @@ import org.apache.camel.api.management.ManagedResource;
 import org.apache.camel.component.infinispan.InfinispanConfiguration;
 import org.apache.camel.component.infinispan.InfinispanManager;
 import org.apache.camel.component.infinispan.InfinispanUtil;
-import org.apache.camel.model.RouteDefinition;
 import org.apache.camel.support.RoutePolicySupport;
 import org.apache.camel.support.service.ServiceSupport;
 import org.apache.camel.util.ObjectHelper;
@@ -113,8 +112,7 @@ public class InfinispanRoutePolicy extends RoutePolicySupport implements CamelCo
         super.onInit(route);
 
         LOGGER.info("Route managed by {}. Setting route {} AutoStartup flag to false.", getClass(), route.getId());
-        RouteDefinition definition = (RouteDefinition) route.getRouteContext().getRoute();
-        definition.setAutoStartup("false");
+        route.getRouteContext().setAutoStartup(false);
 
         stoppeddRoutes.add(route);
 
diff --git a/components/camel-infinispan/src/test/resources/log4j2.properties b/components/camel-infinispan/src/test/resources/log4j2.properties
index eeac9a1..3126fdb 100644
--- a/components/camel-infinispan/src/test/resources/log4j2.properties
+++ b/components/camel-infinispan/src/test/resources/log4j2.properties
@@ -28,4 +28,4 @@ rootLogger.level = INFO
 rootLogger.appenderRef.file.ref = file
 
 logger.infinispan.name = org.apache.camel.component.infinispan
-logger.infinispan.level = DEBUG
+logger.infinispan.level = INFO
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/RouteContext.java b/core/camel-api/src/main/java/org/apache/camel/spi/RouteContext.java
index 8cd6132..2d8c9f4 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/RouteContext.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/RouteContext.java
@@ -178,6 +178,24 @@ public interface RouteContext extends RuntimeConfiguration, EndpointAware {
     void setRoutePolicyList(List<RoutePolicy> routePolicyList);
 
     /**
+     * Sets whether the route should automatically start when Camel starts.
+     * <p/>
+     * Default is <tt>true</tt> to always start up.
+     *
+     * @param autoStartup whether to start up automatically.
+     */
+    void setAutoStartup(Boolean autoStartup);
+
+    /**
+     * Gets whether the route should automatically start when Camel starts.
+     * <p/>
+     * Default is <tt>true</tt> to always start up.
+     *
+     * @return <tt>true</tt> if route should automatically start
+     */
+    Boolean isAutoStartup();
+
+    /**
      * A private counter that increments, is used to as book keeping
      * when building a route based on the model
      * <p/>