You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2017/07/05 12:33:40 UTC

[1/3] camel git commit: Add documentation for HierarchicalPropertiesEvaluator

Repository: camel
Updated Branches:
  refs/heads/master 1a347d2d9 -> dd702e612


Add documentation for HierarchicalPropertiesEvaluator


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a16f8152
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a16f8152
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a16f8152

Branch: refs/heads/master
Commit: a16f8152c1217726b93f4bfc3837db06855028f7
Parents: 1a347d2
Author: lburgazzoli <lb...@gmail.com>
Authored: Wed Jul 5 13:51:48 2017 +0200
Committer: lburgazzoli <lb...@gmail.com>
Committed: Wed Jul 5 13:51:48 2017 +0200

----------------------------------------------------------------------
 .../boot/util/HierarchicalPropertiesEvaluator.java      | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a16f8152/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/util/HierarchicalPropertiesEvaluator.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/util/HierarchicalPropertiesEvaluator.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/util/HierarchicalPropertiesEvaluator.java
index a41effb..fa66a11 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/util/HierarchicalPropertiesEvaluator.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/util/HierarchicalPropertiesEvaluator.java
@@ -23,10 +23,22 @@ public final class HierarchicalPropertiesEvaluator {
     private HierarchicalPropertiesEvaluator() {
     }
 
+    /**
+     * Determine the value of the "enabled" flag for a hierarchy of properties.
+     *
+     * @param environment the environment
+     * @param prefixes an ordered list of prefixed (less restrictive to more restrictive)
+     * @return the value of the key `enabled` for most restrictive prefix
+     */
     public static boolean evaluate(Environment environment, String... prefixes) {
         boolean answer = true;
 
+        // Loop over all the prefixes to find out the value of the key `enabled`
+        // for the most restrictive prefix.
         for (String prefix : prefixes) {
+            // evaluate the value of the current prefix using the parent one
+            // as default value so if the enabled property is not set, the parent
+            // one is used.
             answer = isEnabled(environment, prefix, answer);
         }
 


[2/3] camel git commit: CamelRoutesEndpoint : add prefix so the endpoint can be enabled/disabled

Posted by lb...@apache.org.
CamelRoutesEndpoint : add prefix so the endpoint can be enabled/disabled


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ecd02ea8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ecd02ea8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ecd02ea8

Branch: refs/heads/master
Commit: ecd02ea80a416deddc059ab9f2f67ea938266420
Parents: a16f815
Author: lburgazzoli <lb...@gmail.com>
Authored: Wed Jul 5 14:32:41 2017 +0200
Committer: lburgazzoli <lb...@gmail.com>
Committed: Wed Jul 5 14:32:41 2017 +0200

----------------------------------------------------------------------
 .../camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ecd02ea8/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
index a2a8b06..a131ed1 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
@@ -28,13 +28,15 @@ import org.apache.camel.StatefulService;
 import org.apache.camel.spring.boot.actuate.endpoint.CamelRoutesEndpoint.RouteEndpointInfo;
 import org.springframework.boot.actuate.endpoint.AbstractEndpoint;
 import org.springframework.boot.actuate.endpoint.Endpoint;
+import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
  * {@link Endpoint} to expose {@link org.apache.camel.Route} information.
  */
+@ConfigurationProperties(prefix = "endpoints." + CamelRoutesEndpoint.ENDPOINT_ID)
 public class CamelRoutesEndpoint extends AbstractEndpoint<List<RouteEndpointInfo>> {
 
-    private static final String ENDPOINT_ID = "camelroutes";
+    public static final String ENDPOINT_ID = "camelroutes";
 
     private CamelContext camelContext;
 


[3/3] camel git commit: CamelRoutesEndpoint : add additional configuration metadata

Posted by lb...@apache.org.
CamelRoutesEndpoint : add additional configuration metadata


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dd702e61
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dd702e61
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dd702e61

Branch: refs/heads/master
Commit: dd702e612e38a4147f0e7f26756c2b3d945b6f67
Parents: ecd02ea
Author: lburgazzoli <lb...@gmail.com>
Authored: Wed Jul 5 14:33:08 2017 +0200
Committer: lburgazzoli <lb...@gmail.com>
Committed: Wed Jul 5 14:33:08 2017 +0200

----------------------------------------------------------------------
 .../additional-spring-configuration-metadata.json    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/dd702e61/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 0000000..1c04799
--- /dev/null
+++ b/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,15 @@
+{
+  "properties": [
+    {
+      "name": "endpoints.camelroutes.path",
+      "type": "java.lang.String",
+      "description": "Endpoint URL path."
+    },
+    {
+      "name": "endpoints.camelroutes.enabled",
+      "type": "java.lang.Boolean",
+      "description": "Enable Camel Routes endpoint.",
+      "defaultValue": true
+    }
+  ]
+}
\ No newline at end of file