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/12/07 15:58:15 UTC

[camel] branch master updated: CAMEL-14263: camel-ganglia should use source code generated configurer to avoid reflection configuration.

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 8dbab21  CAMEL-14263: camel-ganglia should use source code generated configurer to avoid reflection configuration.
8dbab21 is described below

commit 8dbab212dc83b86b70bf3444da0c8c784e866099
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 16:57:34 2019 +0100

    CAMEL-14263: camel-ganglia should use source code generated configurer to avoid reflection configuration.
---
 components/camel-ganglia/src/main/docs/ganglia-component.adoc       | 2 +-
 .../java/org/apache/camel/component/ganglia/GangliaComponent.java   | 1 -
 .../org/apache/camel/component/ganglia/GangliaConfiguration.java    | 6 +++---
 .../component/ganglia/springboot/GangliaComponentConfiguration.java | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/components/camel-ganglia/src/main/docs/ganglia-component.adoc b/components/camel-ganglia/src/main/docs/ganglia-component.adoc
index f4c19c8..9fb5270 100644
--- a/components/camel-ganglia/src/main/docs/ganglia-component.adoc
+++ b/components/camel-ganglia/src/main/docs/ganglia-component.adoc
@@ -110,7 +110,7 @@ with the following path and query parameters:
 | *spoofHostname* (producer) | Spoofing information IP:hostname |  | String
 | *tmax* (producer) | Maximum time in seconds that the value can be considered current. After this, Ganglia considers the value to have expired. | 60 | int
 | *ttl* (producer) | If using multicast, set the TTL of the packets | 5 | int
-| *type* (producer) | The type of value | STRING | GMetricType
+| *type* (producer) | The type of value | string | GMetricType
 | *units* (producer) | Any unit of measurement that qualifies the metric, e.g. widgets, litres, bytes. Do not include a prefix such as k (kilo) or m (milli), other tools may scale the units later. The value should be unscaled. |  | String
 | *wireFormat31x* (producer) | Use the wire format of Ganglia 3.1.0 and later versions. Set this to false to use Ganglia 3.0.x or earlier. | true | boolean
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
diff --git a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaComponent.java b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaComponent.java
index 0d7da64..1216ef3 100644
--- a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaComponent.java
+++ b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaComponent.java
@@ -43,7 +43,6 @@ public class GangliaComponent extends DefaultComponent {
         ObjectHelper.notNull(configuration, "configuration");
         GangliaConfiguration config = configuration.copy();
         config.configure(url);
-        setProperties(config, parameters);
 
         GangliaEndpoint endpoint = new GangliaEndpoint(uri, this);
         endpoint.setConfiguration(config);
diff --git a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConfiguration.java b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConfiguration.java
index 42c142f..acdbf3f 100644
--- a/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConfiguration.java
+++ b/components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConfiguration.java
@@ -49,7 +49,7 @@ public class GangliaConfiguration implements Cloneable {
     @UriPath(defaultValue = "" + DEFAULT_PORT)
     private int port = DEFAULT_PORT;
 
-    @UriParam(defaultValue = "MULTICAST")
+    @UriParam(defaultValue = "MULTICAST", enums = "MULTICAST,UNICAST")
     private GMetric.UDPAddressingMode mode = DEFAULT_MODE;
 
     @UriParam(defaultValue = "5")
@@ -70,10 +70,10 @@ public class GangliaConfiguration implements Cloneable {
     @UriParam(defaultValue = "metric")
     private String metricName = DEFAULT_METRIC_NAME;
 
-    @UriParam(defaultValue = "STRING")
+    @UriParam(defaultValue = "string", enums = "string,int8,uint8,int16,uint16,int32,uint32,float,double")
     private GMetricType type = DEFAULT_TYPE;
 
-    @UriParam(defaultValue = "BOTH")
+    @UriParam(defaultValue = "BOTH", enums = "ZERO,POSITIVE,NEGATIVE,BOTH")
     private GMetricSlope slope = DEFAULT_SLOPE;
 
     @UriParam
diff --git a/platforms/spring-boot/components-starter/camel-ganglia-starter/src/main/java/org/apache/camel/component/ganglia/springboot/GangliaComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-ganglia-starter/src/main/java/org/apache/camel/component/ganglia/springboot/GangliaComponentConfiguration.java
index 749b076..ce4a199 100644
--- a/platforms/spring-boot/components-starter/camel-ganglia-starter/src/main/java/org/apache/camel/component/ganglia/springboot/GangliaComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-ganglia-starter/src/main/java/org/apache/camel/component/ganglia/springboot/GangliaComponentConfiguration.java
@@ -145,7 +145,7 @@ public class GangliaComponentConfiguration
         /**
          * The type of value
          */
-        private GMetricType type = GMetricType.STRING;
+        private GMetricType type = GMetricType.string;
         /**
          * The slope
          */