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:15 UTC

[camel] 01/06: CAMEL-15836: Add autowired metadata to camel-log exchangeFormatter 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 73dfdbe50c82fd1fc045e0a6d8ebe485f3a6cc04
Author: James Netherton <ja...@gmail.com>
AuthorDate: Fri Nov 13 10:17:26 2020 +0000

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

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json
index 71ff537..dadc43e 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/log.json
@@ -24,7 +24,7 @@
   "componentProperties": {
     "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 [...]
-    "exchangeFormatter": { "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter." }
+    "exchangeFormatter": { "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter." }
   },
   "properties": {
     "loggerName": { "kind": "path", "displayName": "Logger Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of the logging category to use" },
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc
index be6d0c9..188588c 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/log-component.adoc
@@ -82,7 +82,7 @@ The Log component supports 3 options, which are listed below.
 | Name | Description | Default | Type
 | *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
-| *exchangeFormatter* (advanced) | Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter. |  | ExchangeFormatter
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter. |  | ExchangeFormatter
 |===
 // component options: END
 
diff --git a/components/camel-log/src/generated/java/org/apache/camel/component/log/LogComponentConfigurer.java b/components/camel-log/src/generated/java/org/apache/camel/component/log/LogComponentConfigurer.java
index ca6bf4e..8b2c6a2 100644
--- a/components/camel-log/src/generated/java/org/apache/camel/component/log/LogComponentConfigurer.java
+++ b/components/camel-log/src/generated/java/org/apache/camel/component/log/LogComponentConfigurer.java
@@ -32,6 +32,11 @@ public class LogComponentConfigurer extends PropertyConfigurerSupport implements
     }
 
     @Override
+    public String[] getAutowiredNames() {
+        return new String[]{"exchangeFormatter"};
+    }
+
+    @Override
     public Class<?> getOptionType(String name, boolean ignoreCase) {
         switch (ignoreCase ? name.toLowerCase() : name) {
         case "autowiredenabled":
diff --git a/components/camel-log/src/generated/resources/org/apache/camel/component/log/log.json b/components/camel-log/src/generated/resources/org/apache/camel/component/log/log.json
index 71ff537..dadc43e 100644
--- a/components/camel-log/src/generated/resources/org/apache/camel/component/log/log.json
+++ b/components/camel-log/src/generated/resources/org/apache/camel/component/log/log.json
@@ -24,7 +24,7 @@
   "componentProperties": {
     "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 [...]
-    "exchangeFormatter": { "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": false, "secret": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter." }
+    "exchangeFormatter": { "kind": "property", "displayName": "Exchange Formatter", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExchangeFormatter", "deprecated": false, "autowired": true, "secret": false, "description": "Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter." }
   },
   "properties": {
     "loggerName": { "kind": "path", "displayName": "Logger Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Name of the logging category to use" },
diff --git a/components/camel-log/src/main/docs/log-component.adoc b/components/camel-log/src/main/docs/log-component.adoc
index be6d0c9..188588c 100644
--- a/components/camel-log/src/main/docs/log-component.adoc
+++ b/components/camel-log/src/main/docs/log-component.adoc
@@ -82,7 +82,7 @@ The Log component supports 3 options, which are listed below.
 | Name | Description | Default | Type
 | *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
-| *exchangeFormatter* (advanced) | Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter. |  | ExchangeFormatter
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter. |  | ExchangeFormatter
 |===
 // component options: END
 
diff --git a/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java b/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java
index e46184b..b4e25b2 100644
--- a/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java
+++ b/components/camel-log/src/main/java/org/apache/camel/component/log/LogComponent.java
@@ -40,7 +40,7 @@ public class LogComponent extends DefaultComponent {
 
     private ExchangeFormatter defaultExchangeFormatter;
 
-    @Metadata(label = "advanced")
+    @Metadata(label = "advanced", autowired = true)
     private ExchangeFormatter exchangeFormatter;
 
     public LogComponent() {
diff --git a/docs/components/modules/ROOT/pages/log-component.adoc b/docs/components/modules/ROOT/pages/log-component.adoc
index 3d37e38..443e5a4 100644
--- a/docs/components/modules/ROOT/pages/log-component.adoc
+++ b/docs/components/modules/ROOT/pages/log-component.adoc
@@ -84,7 +84,7 @@ The Log component supports 3 options, which are listed below.
 | Name | Description | Default | Type
 | *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
-| *exchangeFormatter* (advanced) | Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter. |  | ExchangeFormatter
+| *exchangeFormatter* (advanced) | *Autowired* Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter. |  | ExchangeFormatter
 |===
 // component options: END