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/08/24 17:29:15 UTC

[camel] branch master updated (923f855 -> f25a01d)

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

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


    from 923f855  CAMEL-13870: Add @SuppressWarnings to generated configurer.
     new 5d4d371  CAMEL-13870: Generating fast component options configurer
     new f25a01d  CAMEL-13870: Skip known option when autowiring from registry

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/java/org/apache/camel/main/MainSupport.java     | 12 ++++++++++--
 .../org/apache/camel/support/PropertyBindingSupport.java     |  7 ++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)


[camel] 02/02: CAMEL-13870: Skip known option when autowiring from registry

Posted by da...@apache.org.
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

commit f25a01d35135ce23fa5a4648cd64a3f5e8d49a34
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Aug 24 19:29:01 2019 +0200

    CAMEL-13870: Skip known option when autowiring from registry
---
 .../main/java/org/apache/camel/support/PropertyBindingSupport.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
index f45f557..02794f5 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java
@@ -347,7 +347,11 @@ public final class PropertyBindingSupport {
         for (Map.Entry<String, Object> entry : properties.entrySet()) {
             String key = entry.getKey();
             Object value = entry.getValue();
-            Class<?> type = getGetterType(camelContext, target, key, false);
+
+            // skip based on some known names
+            if ("basicPropertyBinding".equals(key)) {
+                continue;
+            }
 
             boolean skip = parents.contains(value) || value instanceof CamelContext;
             if (skip) {
@@ -356,6 +360,7 @@ public final class PropertyBindingSupport {
                 continue;
             }
 
+            Class<?> type = getGetterType(camelContext, target, key, false);
             if (isComplexUserType(type)) {
                 // if the property has not been set and its a complex type (not simple or string etc)
                 if (!bindNullOnly || value == null) {


[camel] 01/02: CAMEL-13870: Generating fast component options configurer

Posted by da...@apache.org.
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

commit 5d4d3715e4ef77ebd823775f5d95df427cd84378
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Aug 24 19:15:00 2019 +0200

    CAMEL-13870: Generating fast component options configurer
---
 .../src/main/java/org/apache/camel/main/MainSupport.java     | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
index 9d32d7d..00a4393 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
@@ -51,6 +51,7 @@ import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.EventNotifier;
 import org.apache.camel.spi.Language;
 import org.apache.camel.spi.PropertiesComponent;
+import org.apache.camel.spi.PropertyConfigurer;
 import org.apache.camel.spi.RestConfiguration;
 import org.apache.camel.support.LifecycleStrategySupport;
 import org.apache.camel.support.PropertyBindingSupport;
@@ -1246,6 +1247,13 @@ public abstract class MainSupport extends ServiceSupport {
         boolean rc = false;
         Iterator it = properties.entrySet().iterator();
 
+        PropertyConfigurer configurer = null;
+        if (target instanceof Component) {
+            // the component needs to be initialized to have the configurer ready
+            ServiceHelper.initService(target);
+            configurer = ((Component) target).getComponentPropertyConfigurer();
+        }
+
         while (it.hasNext()) {
             Map.Entry<String, Object> entry = (Map.Entry) it.next();
             String name = entry.getKey();
@@ -1262,10 +1270,10 @@ public abstract class MainSupport extends ServiceSupport {
             try {
                 boolean hit;
                 if (failIfNotSet) {
-                    PropertyBindingSupport.build().withMandatory(true).withIgnoreCase(ignoreCase).bind(context, target, name, stringValue);
+                    PropertyBindingSupport.build().withMandatory(true).withConfigurer(configurer).withIgnoreCase(ignoreCase).bind(context, target, name, stringValue);
                     hit = true;
                 } else {
-                    hit = PropertyBindingSupport.build().withIgnoreCase(true).bind(context, target, name, stringValue);
+                    hit = PropertyBindingSupport.build().withConfigurer(configurer).withIgnoreCase(true).bind(context, target, name, stringValue);
                 }
                 if (hit) {
                     it.remove();