You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2020/11/13 13:52:19 UTC

[camel] 05/06: CAMEL-15836: Add autowired metadata to camel-influxdb influxDB option

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

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

commit 64cd8286e466422493ec164aae0267a443f4d022
Author: James Netherton <ja...@gmail.com>
AuthorDate: Fri Nov 13 11:04:09 2020 +0000

    CAMEL-15836: Add autowired metadata to camel-influxdb influxDB option
---
 .../resources/org/apache/camel/catalog/components/influxdb.json      | 2 +-
 .../resources/org/apache/camel/catalog/docs/influxdb-component.adoc  | 2 +-
 .../apache/camel/component/influxdb/InfluxDbComponentConfigurer.java | 5 +++++
 .../resources/org/apache/camel/component/influxdb/influxdb.json      | 2 +-
 components/camel-influxdb/src/main/docs/influxdb-component.adoc      | 2 +-
 .../java/org/apache/camel/component/influxdb/InfluxDbComponent.java  | 2 +-
 docs/components/modules/ROOT/pages/influxdb-component.adoc           | 2 +-
 7 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/influxdb.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/influxdb.json
index c3b0749..7bfbf55 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/influxdb.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/influxdb.json
@@ -22,7 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "influxDB": { "kind": "property", "displayName": "Influx DB", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.influxdb.InfluxDB", "deprecated": false, "autowired": false, "secret": false, "description": "The shared Influx DB to use for all endpoints" },
+    "influxDB": { "kind": "property", "displayName": "Influx DB", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.influxdb.InfluxDB", "deprecated": false, "autowired": true, "secret": false, "description": "The shared Influx DB to use for all endpoints" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
   },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/influxdb-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/influxdb-component.adoc
index 7215d88..0ceaa22 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/influxdb-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/influxdb-component.adoc
@@ -58,7 +58,7 @@ The InfluxDB component supports 3 options, which are listed below.
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *influxDB* (producer) | The shared Influx DB to use for all endpoints |  | InfluxDB
+| *influxDB* (producer) | *Autowired* The shared Influx DB to use for all endpoints |  | InfluxDB
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
 |===
diff --git a/components/camel-influxdb/src/generated/java/org/apache/camel/component/influxdb/InfluxDbComponentConfigurer.java b/components/camel-influxdb/src/generated/java/org/apache/camel/component/influxdb/InfluxDbComponentConfigurer.java
index 21f11a8..4882ab0 100644
--- a/components/camel-influxdb/src/generated/java/org/apache/camel/component/influxdb/InfluxDbComponentConfigurer.java
+++ b/components/camel-influxdb/src/generated/java/org/apache/camel/component/influxdb/InfluxDbComponentConfigurer.java
@@ -32,6 +32,11 @@ public class InfluxDbComponentConfigurer extends PropertyConfigurerSupport imple
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"influxDB"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "autowiredenabled":
diff --git a/components/camel-influxdb/src/generated/resources/org/apache/camel/component/influxdb/influxdb.json b/components/camel-influxdb/src/generated/resources/org/apache/camel/component/influxdb/influxdb.json
index c3b0749..7bfbf55 100644
--- a/components/camel-influxdb/src/generated/resources/org/apache/camel/component/influxdb/influxdb.json
+++ b/components/camel-influxdb/src/generated/resources/org/apache/camel/component/influxdb/influxdb.json
@@ -22,7 +22,7 @@
     "lenientProperties": false
   },
   "componentProperties": {
-    "influxDB": { "kind": "property", "displayName": "Influx DB", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.influxdb.InfluxDB", "deprecated": false, "autowired": false, "secret": false, "description": "The shared Influx DB to use for all endpoints" },
+    "influxDB": { "kind": "property", "displayName": "Influx DB", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.influxdb.InfluxDB", "deprecated": false, "autowired": true, "secret": false, "description": "The shared Influx DB to use for all endpoints" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during star [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
   },
diff --git a/components/camel-influxdb/src/main/docs/influxdb-component.adoc b/components/camel-influxdb/src/main/docs/influxdb-component.adoc
index 7215d88..0ceaa22 100644
--- a/components/camel-influxdb/src/main/docs/influxdb-component.adoc
+++ b/components/camel-influxdb/src/main/docs/influxdb-component.adoc
@@ -58,7 +58,7 @@ The InfluxDB component supports 3 options, which are listed below.
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *influxDB* (producer) | The shared Influx DB to use for all endpoints |  | InfluxDB
+| *influxDB* (producer) | *Autowired* The shared Influx DB to use for all endpoints |  | InfluxDB
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
 |===
diff --git a/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/InfluxDbComponent.java b/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/InfluxDbComponent.java
index 937d983..866eaa7 100644
--- a/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/InfluxDbComponent.java
+++ b/components/camel-influxdb/src/main/java/org/apache/camel/component/influxdb/InfluxDbComponent.java
@@ -28,7 +28,7 @@ import org.influxdb.InfluxDB;
 @Component("influxdb")
 public class InfluxDbComponent extends DefaultComponent {
 
-    @Metadata
+    @Metadata(autowired = true)
     private InfluxDB influxDB;
 
     public InfluxDbComponent() {
diff --git a/docs/components/modules/ROOT/pages/influxdb-component.adoc b/docs/components/modules/ROOT/pages/influxdb-component.adoc
index f590360..2164f7e 100644
--- a/docs/components/modules/ROOT/pages/influxdb-component.adoc
+++ b/docs/components/modules/ROOT/pages/influxdb-component.adoc
@@ -60,7 +60,7 @@ The InfluxDB component supports 3 options, which are listed below.
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *influxDB* (producer) | The shared Influx DB to use for all endpoints |  | InfluxDB
+| *influxDB* (producer) | *Autowired* The shared Influx DB to use for all endpoints |  | InfluxDB
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and [...]
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
 |===