camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [02/21] camel git commit: camel-spring-boot: improve customizer configuration
Date Mon, 22 May 2017 12:03:40 GMT
http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatAutoConfiguration.java
index 17e6b89..b7c67d5 100644
--- a/platforms/spring-boot/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xmlbeans-starter/src/main/java/org/apache/camel/converter/xmlbeans/springboot/XmlBeansDataFormatAutoConfiguration.java
@@ -27,10 +27,12 @@ import org.apache.camel.converter.xmlbeans.XmlBeansDataFormat;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatCustomizer;
 import org.apache.camel.spi.DataFormatFactory;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.DataFormatConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,6 +42,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -59,13 +62,13 @@ public class XmlBeansDataFormatAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XmlBeansDataFormatAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XmlBeansDataFormatConfiguration configuration;
     @Autowired(required = false)
     private List<DataFormatCustomizer<XmlBeansDataFormat>> customizers;
-    @Autowired
-    private DataFormatConfigurationProperties globalConfiguration;
-    @Autowired
-    private XmlBeansDataFormatConfiguration dataformatConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -91,7 +94,7 @@ public class XmlBeansDataFormatAutoConfiguration {
                 }
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(dataformatConfiguration,
+                    IntrospectionSupport.getProperties(configuration,
                             parameters, null, false);
                     IntrospectionSupport.setProperties(camelContext,
                             camelContext.getTypeConverter(), dataformat,
@@ -99,15 +102,24 @@ public class XmlBeansDataFormatAutoConfiguration {
                 } catch (Exception e) {
                     throw new RuntimeCamelException(e);
                 }
-                boolean useCustomizers = globalConfiguration.getCustomizer()
-                        .isEnabled()
-                        && dataformatConfiguration.getCustomizer().isEnabled();
-                if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+                if (ObjectHelper.isNotEmpty(customizers)) {
                     for (DataFormatCustomizer<XmlBeansDataFormat> customizer : customizers) {
-                        LOGGER.debug(
-                                "Configure dataformat {}, with customizer {}",
-                                dataformat, customizer);
-                        customizer.customize(dataformat);
+                        boolean useCustomizer = (customizer instanceof HasId)
+                                ? HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xmlbeans.customizer",
+                                        ((HasId) customizer).getId())
+                                : HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xmlbeans.customizer");
+                        if (useCustomizer) {
+                            LOGGER.debug(
+                                    "Configure dataformat {}, with customizer {}",
+                                    dataformat, customizer);
+                            customizer.customize(dataformat);
+                        }
                     }
                 }
                 return dataformat;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatAutoConfiguration.java
index 553eb55..ed6e3ce 100644
--- a/platforms/spring-boot/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xmljson-starter/src/main/java/org/apache/camel/dataformat/xmljson/springboot/XmlJsonDataFormatAutoConfiguration.java
@@ -27,10 +27,12 @@ import org.apache.camel.dataformat.xmljson.XmlJsonDataFormat;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatCustomizer;
 import org.apache.camel.spi.DataFormatFactory;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.DataFormatConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,6 +42,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -59,13 +62,13 @@ public class XmlJsonDataFormatAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XmlJsonDataFormatAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XmlJsonDataFormatConfiguration configuration;
     @Autowired(required = false)
     private List<DataFormatCustomizer<XmlJsonDataFormat>> customizers;
-    @Autowired
-    private DataFormatConfigurationProperties globalConfiguration;
-    @Autowired
-    private XmlJsonDataFormatConfiguration dataformatConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -91,7 +94,7 @@ public class XmlJsonDataFormatAutoConfiguration {
                 }
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(dataformatConfiguration,
+                    IntrospectionSupport.getProperties(configuration,
                             parameters, null, false);
                     IntrospectionSupport.setProperties(camelContext,
                             camelContext.getTypeConverter(), dataformat,
@@ -99,15 +102,24 @@ public class XmlJsonDataFormatAutoConfiguration {
                 } catch (Exception e) {
                     throw new RuntimeCamelException(e);
                 }
-                boolean useCustomizers = globalConfiguration.getCustomizer()
-                        .isEnabled()
-                        && dataformatConfiguration.getCustomizer().isEnabled();
-                if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+                if (ObjectHelper.isNotEmpty(customizers)) {
                     for (DataFormatCustomizer<XmlJsonDataFormat> customizer : customizers) {
-                        LOGGER.debug(
-                                "Configure dataformat {}, with customizer {}",
-                                dataformat, customizer);
-                        customizer.customize(dataformat);
+                        boolean useCustomizer = (customizer instanceof HasId)
+                                ? HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xmljson.customizer",
+                                        ((HasId) customizer).getId())
+                                : HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xmljson.customizer");
+                        if (useCustomizer) {
+                            LOGGER.debug(
+                                    "Configure dataformat {}, with customizer {}",
+                                    dataformat, customizer);
+                            customizer.customize(dataformat);
+                        }
                     }
                 }
                 return dataformat;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/component/xmlrpc/springboot/XmlRpcComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/component/xmlrpc/springboot/XmlRpcComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/component/xmlrpc/springboot/XmlRpcComponentAutoConfiguration.java
index 267dee8..b53e5a1 100644
--- a/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/component/xmlrpc/springboot/XmlRpcComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/component/xmlrpc/springboot/XmlRpcComponentAutoConfiguration.java
@@ -23,10 +23,12 @@ import javax.annotation.Generated;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.xmlrpc.XmlRpcComponent;
 import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.ComponentConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -56,13 +59,13 @@ public class XmlRpcComponentAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XmlRpcComponentAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XmlRpcComponentConfiguration configuration;
     @Autowired(required = false)
     private List<ComponentCustomizer<XmlRpcComponent>> customizers;
-    @Autowired
-    private ComponentConfigurationProperties globalConfiguration;
-    @Autowired
-    private XmlRpcComponentConfiguration componentConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -77,8 +80,8 @@ public class XmlRpcComponentAutoConfiguration {
         XmlRpcComponent component = new XmlRpcComponent();
         component.setCamelContext(camelContext);
         Map<String, Object> parameters = new HashMap<>();
-        IntrospectionSupport.getProperties(componentConfiguration, parameters,
-                null, false);
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
         for (Map.Entry<String, Object> entry : parameters.entrySet()) {
             Object value = entry.getValue();
             Class<?> paramClass = value.getClass();
@@ -101,14 +104,23 @@ public class XmlRpcComponentAutoConfiguration {
         }
         IntrospectionSupport.setProperties(camelContext,
                 camelContext.getTypeConverter(), component, parameters);
-        boolean useCustomizers = globalConfiguration.getCustomizer()
-                .isEnabled()
-                && componentConfiguration.getCustomizer().isEnabled();
-        if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+        if (ObjectHelper.isNotEmpty(customizers)) {
             for (ComponentCustomizer<XmlRpcComponent> customizer : customizers) {
-                LOGGER.debug("Configure component {}, with customizer {}",
-                        component, customizer);
-                customizer.customize(component);
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.xmlrpc.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.xmlrpc.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
             }
         }
         return component;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatAutoConfiguration.java
index 601cacd..63fb41f 100644
--- a/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xmlrpc-starter/src/main/java/org/apache/camel/dataformat/xmlrpc/springboot/XmlRpcDataFormatAutoConfiguration.java
@@ -27,10 +27,12 @@ import org.apache.camel.dataformat.xmlrpc.XmlRpcDataFormat;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatCustomizer;
 import org.apache.camel.spi.DataFormatFactory;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.DataFormatConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,6 +42,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -59,13 +62,13 @@ public class XmlRpcDataFormatAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XmlRpcDataFormatAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XmlRpcDataFormatConfiguration configuration;
     @Autowired(required = false)
     private List<DataFormatCustomizer<XmlRpcDataFormat>> customizers;
-    @Autowired
-    private DataFormatConfigurationProperties globalConfiguration;
-    @Autowired
-    private XmlRpcDataFormatConfiguration dataformatConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -91,7 +94,7 @@ public class XmlRpcDataFormatAutoConfiguration {
                 }
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(dataformatConfiguration,
+                    IntrospectionSupport.getProperties(configuration,
                             parameters, null, false);
                     IntrospectionSupport.setProperties(camelContext,
                             camelContext.getTypeConverter(), dataformat,
@@ -99,15 +102,24 @@ public class XmlRpcDataFormatAutoConfiguration {
                 } catch (Exception e) {
                     throw new RuntimeCamelException(e);
                 }
-                boolean useCustomizers = globalConfiguration.getCustomizer()
-                        .isEnabled()
-                        && dataformatConfiguration.getCustomizer().isEnabled();
-                if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+                if (ObjectHelper.isNotEmpty(customizers)) {
                     for (DataFormatCustomizer<XmlRpcDataFormat> customizer : customizers) {
-                        LOGGER.debug(
-                                "Configure dataformat {}, with customizer {}",
-                                dataformat, customizer);
-                        customizer.customize(dataformat);
+                        boolean useCustomizer = (customizer instanceof HasId)
+                                ? HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xmlrpc.customizer",
+                                        ((HasId) customizer).getId())
+                                : HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xmlrpc.customizer");
+                        if (useCustomizer) {
+                            LOGGER.debug(
+                                    "Configure dataformat {}, with customizer {}",
+                                    dataformat, customizer);
+                            customizer.customize(dataformat);
+                        }
                     }
                 }
                 return dataformat;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/component/xmlsecurity/springboot/XmlSignatureComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/component/xmlsecurity/springboot/XmlSignatureComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/component/xmlsecurity/springboot/XmlSignatureComponentAutoConfiguration.java
index 2f0d150..b3f9407 100644
--- a/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/component/xmlsecurity/springboot/XmlSignatureComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/component/xmlsecurity/springboot/XmlSignatureComponentAutoConfiguration.java
@@ -23,10 +23,12 @@ import javax.annotation.Generated;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.xmlsecurity.XmlSignatureComponent;
 import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.ComponentConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -56,13 +59,13 @@ public class XmlSignatureComponentAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XmlSignatureComponentAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XmlSignatureComponentConfiguration configuration;
     @Autowired(required = false)
     private List<ComponentCustomizer<XmlSignatureComponent>> customizers;
-    @Autowired
-    private ComponentConfigurationProperties globalConfiguration;
-    @Autowired
-    private XmlSignatureComponentConfiguration componentConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -78,8 +81,8 @@ public class XmlSignatureComponentAutoConfiguration {
         XmlSignatureComponent component = new XmlSignatureComponent();
         component.setCamelContext(camelContext);
         Map<String, Object> parameters = new HashMap<>();
-        IntrospectionSupport.getProperties(componentConfiguration, parameters,
-                null, false);
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
         for (Map.Entry<String, Object> entry : parameters.entrySet()) {
             Object value = entry.getValue();
             Class<?> paramClass = value.getClass();
@@ -102,14 +105,23 @@ public class XmlSignatureComponentAutoConfiguration {
         }
         IntrospectionSupport.setProperties(camelContext,
                 camelContext.getTypeConverter(), component, parameters);
-        boolean useCustomizers = globalConfiguration.getCustomizer()
-                .isEnabled()
-                && componentConfiguration.getCustomizer().isEnabled();
-        if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+        if (ObjectHelper.isNotEmpty(customizers)) {
             for (ComponentCustomizer<XmlSignatureComponent> customizer : customizers) {
-                LOGGER.debug("Configure component {}, with customizer {}",
-                        component, customizer);
-                customizer.customize(component);
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.xmlsecurity.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.xmlsecurity.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
             }
         }
         return component;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatAutoConfiguration.java
index ba80612..46a1011 100644
--- a/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xmlsecurity-starter/src/main/java/org/apache/camel/dataformat/xmlsecurity/springboot/XMLSecurityDataFormatAutoConfiguration.java
@@ -27,10 +27,12 @@ import org.apache.camel.dataformat.xmlsecurity.XMLSecurityDataFormat;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatCustomizer;
 import org.apache.camel.spi.DataFormatFactory;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.DataFormatConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,6 +42,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -59,13 +62,13 @@ public class XMLSecurityDataFormatAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XMLSecurityDataFormatAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XMLSecurityDataFormatConfiguration configuration;
     @Autowired(required = false)
     private List<DataFormatCustomizer<XMLSecurityDataFormat>> customizers;
-    @Autowired
-    private DataFormatConfigurationProperties globalConfiguration;
-    @Autowired
-    private XMLSecurityDataFormatConfiguration dataformatConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -91,7 +94,7 @@ public class XMLSecurityDataFormatAutoConfiguration {
                 }
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(dataformatConfiguration,
+                    IntrospectionSupport.getProperties(configuration,
                             parameters, null, false);
                     IntrospectionSupport.setProperties(camelContext,
                             camelContext.getTypeConverter(), dataformat,
@@ -99,15 +102,27 @@ public class XMLSecurityDataFormatAutoConfiguration {
                 } catch (Exception e) {
                     throw new RuntimeCamelException(e);
                 }
-                boolean useCustomizers = globalConfiguration.getCustomizer()
-                        .isEnabled()
-                        && dataformatConfiguration.getCustomizer().isEnabled();
-                if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+                if (ObjectHelper.isNotEmpty(customizers)) {
                     for (DataFormatCustomizer<XMLSecurityDataFormat> customizer : customizers) {
-                        LOGGER.debug(
-                                "Configure dataformat {}, with customizer {}",
-                                dataformat, customizer);
-                        customizer.customize(dataformat);
+                        boolean useCustomizer = (customizer instanceof HasId)
+                                ? HierarchicalPropertiesEvaluator
+                                        .evaluate(
+                                                applicationContext
+                                                        .getEnvironment(),
+                                                "camel.dataformat.customizer",
+                                                "camel.dataformat.securexml.customizer",
+                                                ((HasId) customizer).getId())
+                                : HierarchicalPropertiesEvaluator
+                                        .evaluate(applicationContext
+                                                .getEnvironment(),
+                                                "camel.dataformat.customizer",
+                                                "camel.dataformat.securexml.customizer");
+                        if (useCustomizer) {
+                            LOGGER.debug(
+                                    "Configure dataformat {}, with customizer {}",
+                                    dataformat, customizer);
+                            customizer.customize(dataformat);
+                        }
                     }
                 }
                 return dataformat;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xmpp-starter/src/main/java/org/apache/camel/component/xmpp/springboot/XmppComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xmpp-starter/src/main/java/org/apache/camel/component/xmpp/springboot/XmppComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xmpp-starter/src/main/java/org/apache/camel/component/xmpp/springboot/XmppComponentAutoConfiguration.java
index 50bf6e5..8fdfe96 100644
--- a/platforms/spring-boot/components-starter/camel-xmpp-starter/src/main/java/org/apache/camel/component/xmpp/springboot/XmppComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xmpp-starter/src/main/java/org/apache/camel/component/xmpp/springboot/XmppComponentAutoConfiguration.java
@@ -23,10 +23,12 @@ import javax.annotation.Generated;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.xmpp.XmppComponent;
 import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.ComponentConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -56,13 +59,13 @@ public class XmppComponentAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XmppComponentAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XmppComponentConfiguration configuration;
     @Autowired(required = false)
     private List<ComponentCustomizer<XmppComponent>> customizers;
-    @Autowired
-    private ComponentConfigurationProperties globalConfiguration;
-    @Autowired
-    private XmppComponentConfiguration componentConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -77,8 +80,8 @@ public class XmppComponentAutoConfiguration {
         XmppComponent component = new XmppComponent();
         component.setCamelContext(camelContext);
         Map<String, Object> parameters = new HashMap<>();
-        IntrospectionSupport.getProperties(componentConfiguration, parameters,
-                null, false);
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
         for (Map.Entry<String, Object> entry : parameters.entrySet()) {
             Object value = entry.getValue();
             Class<?> paramClass = value.getClass();
@@ -101,14 +104,23 @@ public class XmppComponentAutoConfiguration {
         }
         IntrospectionSupport.setProperties(camelContext,
                 camelContext.getTypeConverter(), component, parameters);
-        boolean useCustomizers = globalConfiguration.getCustomizer()
-                .isEnabled()
-                && componentConfiguration.getCustomizer().isEnabled();
-        if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+        if (ObjectHelper.isNotEmpty(customizers)) {
             for (ComponentCustomizer<XmppComponent> customizer : customizers) {
-                LOGGER.debug("Configure component {}, with customizer {}",
-                        component, customizer);
-                customizer.customize(component);
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.xmpp.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.xmpp.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
             }
         }
         return component;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatAutoConfiguration.java
index cc88870..ddae965 100644
--- a/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/JsonDataFormatAutoConfiguration.java
@@ -27,10 +27,12 @@ import org.apache.camel.dataformat.xstream.JsonDataFormat;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatCustomizer;
 import org.apache.camel.spi.DataFormatFactory;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.DataFormatConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,6 +42,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -59,13 +62,13 @@ public class JsonDataFormatAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(JsonDataFormatAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private JsonDataFormatConfiguration configuration;
     @Autowired(required = false)
     private List<DataFormatCustomizer<JsonDataFormat>> customizers;
-    @Autowired
-    private DataFormatConfigurationProperties globalConfiguration;
-    @Autowired
-    private JsonDataFormatConfiguration dataformatConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -90,7 +93,7 @@ public class JsonDataFormatAutoConfiguration {
                 }
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(dataformatConfiguration,
+                    IntrospectionSupport.getProperties(configuration,
                             parameters, null, false);
                     IntrospectionSupport.setProperties(camelContext,
                             camelContext.getTypeConverter(), dataformat,
@@ -98,15 +101,27 @@ public class JsonDataFormatAutoConfiguration {
                 } catch (Exception e) {
                     throw new RuntimeCamelException(e);
                 }
-                boolean useCustomizers = globalConfiguration.getCustomizer()
-                        .isEnabled()
-                        && dataformatConfiguration.getCustomizer().isEnabled();
-                if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+                if (ObjectHelper.isNotEmpty(customizers)) {
                     for (DataFormatCustomizer<JsonDataFormat> customizer : customizers) {
-                        LOGGER.debug(
-                                "Configure dataformat {}, with customizer {}",
-                                dataformat, customizer);
-                        customizer.customize(dataformat);
+                        boolean useCustomizer = (customizer instanceof HasId)
+                                ? HierarchicalPropertiesEvaluator
+                                        .evaluate(
+                                                applicationContext
+                                                        .getEnvironment(),
+                                                "camel.dataformat.customizer",
+                                                "camel.dataformat.json-xstream.customizer",
+                                                ((HasId) customizer).getId())
+                                : HierarchicalPropertiesEvaluator
+                                        .evaluate(applicationContext
+                                                .getEnvironment(),
+                                                "camel.dataformat.customizer",
+                                                "camel.dataformat.json-xstream.customizer");
+                        if (useCustomizer) {
+                            LOGGER.debug(
+                                    "Configure dataformat {}, with customizer {}",
+                                    dataformat, customizer);
+                            customizer.customize(dataformat);
+                        }
                     }
                 }
                 return dataformat;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatAutoConfiguration.java
index 5b2e65c..da4e6f7 100644
--- a/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-xstream-starter/src/main/java/org/apache/camel/dataformat/xstream/springboot/XStreamDataFormatAutoConfiguration.java
@@ -27,10 +27,12 @@ import org.apache.camel.dataformat.xstream.XStreamDataFormat;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatCustomizer;
 import org.apache.camel.spi.DataFormatFactory;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.DataFormatConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,6 +42,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -59,13 +62,13 @@ public class XStreamDataFormatAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(XStreamDataFormatAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private XStreamDataFormatConfiguration configuration;
     @Autowired(required = false)
     private List<DataFormatCustomizer<XStreamDataFormat>> customizers;
-    @Autowired
-    private DataFormatConfigurationProperties globalConfiguration;
-    @Autowired
-    private XStreamDataFormatConfiguration dataformatConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -91,7 +94,7 @@ public class XStreamDataFormatAutoConfiguration {
                 }
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(dataformatConfiguration,
+                    IntrospectionSupport.getProperties(configuration,
                             parameters, null, false);
                     IntrospectionSupport.setProperties(camelContext,
                             camelContext.getTypeConverter(), dataformat,
@@ -99,15 +102,24 @@ public class XStreamDataFormatAutoConfiguration {
                 } catch (Exception e) {
                     throw new RuntimeCamelException(e);
                 }
-                boolean useCustomizers = globalConfiguration.getCustomizer()
-                        .isEnabled()
-                        && dataformatConfiguration.getCustomizer().isEnabled();
-                if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+                if (ObjectHelper.isNotEmpty(customizers)) {
                     for (DataFormatCustomizer<XStreamDataFormat> customizer : customizers) {
-                        LOGGER.debug(
-                                "Configure dataformat {}, with customizer {}",
-                                dataformat, customizer);
-                        customizer.customize(dataformat);
+                        boolean useCustomizer = (customizer instanceof HasId)
+                                ? HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xstream.customizer",
+                                        ((HasId) customizer).getId())
+                                : HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.xstream.customizer");
+                        if (useCustomizer) {
+                            LOGGER.debug(
+                                    "Configure dataformat {}, with customizer {}",
+                                    dataformat, customizer);
+                            customizer.customize(dataformat);
+                        }
                     }
                 }
                 return dataformat;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-yammer-starter/src/main/java/org/apache/camel/component/yammer/springboot/YammerComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-yammer-starter/src/main/java/org/apache/camel/component/yammer/springboot/YammerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-yammer-starter/src/main/java/org/apache/camel/component/yammer/springboot/YammerComponentAutoConfiguration.java
index 8acf7a0..92a27e9 100644
--- a/platforms/spring-boot/components-starter/camel-yammer-starter/src/main/java/org/apache/camel/component/yammer/springboot/YammerComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-yammer-starter/src/main/java/org/apache/camel/component/yammer/springboot/YammerComponentAutoConfiguration.java
@@ -23,10 +23,12 @@ import javax.annotation.Generated;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.yammer.YammerComponent;
 import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.ComponentConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -56,13 +59,13 @@ public class YammerComponentAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(YammerComponentAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private YammerComponentConfiguration configuration;
     @Autowired(required = false)
     private List<ComponentCustomizer<YammerComponent>> customizers;
-    @Autowired
-    private ComponentConfigurationProperties globalConfiguration;
-    @Autowired
-    private YammerComponentConfiguration componentConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -77,8 +80,8 @@ public class YammerComponentAutoConfiguration {
         YammerComponent component = new YammerComponent();
         component.setCamelContext(camelContext);
         Map<String, Object> parameters = new HashMap<>();
-        IntrospectionSupport.getProperties(componentConfiguration, parameters,
-                null, false);
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
         for (Map.Entry<String, Object> entry : parameters.entrySet()) {
             Object value = entry.getValue();
             Class<?> paramClass = value.getClass();
@@ -101,14 +104,23 @@ public class YammerComponentAutoConfiguration {
         }
         IntrospectionSupport.setProperties(camelContext,
                 camelContext.getTypeConverter(), component, parameters);
-        boolean useCustomizers = globalConfiguration.getCustomizer()
-                .isEnabled()
-                && componentConfiguration.getCustomizer().isEnabled();
-        if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+        if (ObjectHelper.isNotEmpty(customizers)) {
             for (ComponentCustomizer<YammerComponent> customizer : customizers) {
-                LOGGER.debug("Configure component {}, with customizer {}",
-                        component, customizer);
-                customizer.customize(component);
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.yammer.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.yammer.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
             }
         }
         return component;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-zendesk-starter/src/main/java/org/apache/camel/component/zendesk/springboot/ZendeskComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-zendesk-starter/src/main/java/org/apache/camel/component/zendesk/springboot/ZendeskComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-zendesk-starter/src/main/java/org/apache/camel/component/zendesk/springboot/ZendeskComponentAutoConfiguration.java
index ffbcb5e..2b41ab3 100644
--- a/platforms/spring-boot/components-starter/camel-zendesk-starter/src/main/java/org/apache/camel/component/zendesk/springboot/ZendeskComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-zendesk-starter/src/main/java/org/apache/camel/component/zendesk/springboot/ZendeskComponentAutoConfiguration.java
@@ -23,10 +23,12 @@ import javax.annotation.Generated;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.zendesk.ZendeskComponent;
 import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.ComponentConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -56,13 +59,13 @@ public class ZendeskComponentAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(ZendeskComponentAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private ZendeskComponentConfiguration configuration;
     @Autowired(required = false)
     private List<ComponentCustomizer<ZendeskComponent>> customizers;
-    @Autowired
-    private ComponentConfigurationProperties globalConfiguration;
-    @Autowired
-    private ZendeskComponentConfiguration componentConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -77,8 +80,8 @@ public class ZendeskComponentAutoConfiguration {
         ZendeskComponent component = new ZendeskComponent();
         component.setCamelContext(camelContext);
         Map<String, Object> parameters = new HashMap<>();
-        IntrospectionSupport.getProperties(componentConfiguration, parameters,
-                null, false);
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
         for (Map.Entry<String, Object> entry : parameters.entrySet()) {
             Object value = entry.getValue();
             Class<?> paramClass = value.getClass();
@@ -101,14 +104,23 @@ public class ZendeskComponentAutoConfiguration {
         }
         IntrospectionSupport.setProperties(camelContext,
                 camelContext.getTypeConverter(), component, parameters);
-        boolean useCustomizers = globalConfiguration.getCustomizer()
-                .isEnabled()
-                && componentConfiguration.getCustomizer().isEnabled();
-        if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+        if (ObjectHelper.isNotEmpty(customizers)) {
             for (ComponentCustomizer<ZendeskComponent> customizer : customizers) {
-                LOGGER.debug("Configure component {}, with customizer {}",
-                        component, customizer);
-                customizer.customize(component);
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.zendesk.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.zendesk.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
             }
         }
         return component;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatAutoConfiguration.java
index 781f8ff..b66a0e8 100644
--- a/platforms/spring-boot/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-zipfile-starter/src/main/java/org/apache/camel/dataformat/zipfile/springboot/ZipFileDataFormatAutoConfiguration.java
@@ -27,10 +27,12 @@ import org.apache.camel.dataformat.zipfile.ZipFileDataFormat;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatCustomizer;
 import org.apache.camel.spi.DataFormatFactory;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.DataFormatConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -40,6 +42,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -59,13 +62,13 @@ public class ZipFileDataFormatAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(ZipFileDataFormatAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private ZipFileDataFormatConfiguration configuration;
     @Autowired(required = false)
     private List<DataFormatCustomizer<ZipFileDataFormat>> customizers;
-    @Autowired
-    private DataFormatConfigurationProperties globalConfiguration;
-    @Autowired
-    private ZipFileDataFormatConfiguration dataformatConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -91,7 +94,7 @@ public class ZipFileDataFormatAutoConfiguration {
                 }
                 try {
                     Map<String, Object> parameters = new HashMap<>();
-                    IntrospectionSupport.getProperties(dataformatConfiguration,
+                    IntrospectionSupport.getProperties(configuration,
                             parameters, null, false);
                     IntrospectionSupport.setProperties(camelContext,
                             camelContext.getTypeConverter(), dataformat,
@@ -99,15 +102,24 @@ public class ZipFileDataFormatAutoConfiguration {
                 } catch (Exception e) {
                     throw new RuntimeCamelException(e);
                 }
-                boolean useCustomizers = globalConfiguration.getCustomizer()
-                        .isEnabled()
-                        && dataformatConfiguration.getCustomizer().isEnabled();
-                if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+                if (ObjectHelper.isNotEmpty(customizers)) {
                     for (DataFormatCustomizer<ZipFileDataFormat> customizer : customizers) {
-                        LOGGER.debug(
-                                "Configure dataformat {}, with customizer {}",
-                                dataformat, customizer);
-                        customizer.customize(dataformat);
+                        boolean useCustomizer = (customizer instanceof HasId)
+                                ? HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.zipfile.customizer",
+                                        ((HasId) customizer).getId())
+                                : HierarchicalPropertiesEvaluator.evaluate(
+                                        applicationContext.getEnvironment(),
+                                        "camel.dataformat.customizer",
+                                        "camel.dataformat.zipfile.customizer");
+                        if (useCustomizer) {
+                            LOGGER.debug(
+                                    "Configure dataformat {}, with customizer {}",
+                                    dataformat, customizer);
+                            customizer.customize(dataformat);
+                        }
                     }
                 }
                 return dataformat;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-zookeeper-master-starter/src/main/java/org/apache/camel/component/zookeepermaster/springboot/MasterComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-zookeeper-master-starter/src/main/java/org/apache/camel/component/zookeepermaster/springboot/MasterComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-zookeeper-master-starter/src/main/java/org/apache/camel/component/zookeepermaster/springboot/MasterComponentAutoConfiguration.java
index 420901c..86b1b79 100644
--- a/platforms/spring-boot/components-starter/camel-zookeeper-master-starter/src/main/java/org/apache/camel/component/zookeepermaster/springboot/MasterComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-zookeeper-master-starter/src/main/java/org/apache/camel/component/zookeepermaster/springboot/MasterComponentAutoConfiguration.java
@@ -23,10 +23,12 @@ import javax.annotation.Generated;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.zookeepermaster.MasterComponent;
 import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.ComponentConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -56,13 +59,13 @@ public class MasterComponentAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(MasterComponentAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private MasterComponentConfiguration configuration;
     @Autowired(required = false)
     private List<ComponentCustomizer<MasterComponent>> customizers;
-    @Autowired
-    private ComponentConfigurationProperties globalConfiguration;
-    @Autowired
-    private MasterComponentConfiguration componentConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -77,8 +80,8 @@ public class MasterComponentAutoConfiguration {
         MasterComponent component = new MasterComponent();
         component.setCamelContext(camelContext);
         Map<String, Object> parameters = new HashMap<>();
-        IntrospectionSupport.getProperties(componentConfiguration, parameters,
-                null, false);
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
         for (Map.Entry<String, Object> entry : parameters.entrySet()) {
             Object value = entry.getValue();
             Class<?> paramClass = value.getClass();
@@ -101,14 +104,23 @@ public class MasterComponentAutoConfiguration {
         }
         IntrospectionSupport.setProperties(camelContext,
                 camelContext.getTypeConverter(), component, parameters);
-        boolean useCustomizers = globalConfiguration.getCustomizer()
-                .isEnabled()
-                && componentConfiguration.getCustomizer().isEnabled();
-        if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+        if (ObjectHelper.isNotEmpty(customizers)) {
             for (ComponentCustomizer<MasterComponent> customizer : customizers) {
-                LOGGER.debug("Configure component {}, with customizer {}",
-                        component, customizer);
-                customizer.customize(component);
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.zookeeper-master.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.zookeeper-master.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
             }
         }
         return component;

http://git-wip-us.apache.org/repos/asf/camel/blob/1ca7a426/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentAutoConfiguration.java
index adeb30c..09748b3 100644
--- a/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-zookeeper-starter/src/main/java/org/apache/camel/component/zookeeper/springboot/ZooKeeperComponentAutoConfiguration.java
@@ -23,10 +23,12 @@ import javax.annotation.Generated;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.zookeeper.ZooKeeperComponent;
 import org.apache.camel.spi.ComponentCustomizer;
+import org.apache.camel.spi.HasId;
 import org.apache.camel.spring.boot.CamelAutoConfiguration;
 import org.apache.camel.spring.boot.ComponentConfigurationProperties;
 import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans;
 import org.apache.camel.spring.boot.util.GroupCondition;
+import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator;
 import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
 import org.springframework.context.annotation.Configuration;
@@ -56,13 +59,13 @@ public class ZooKeeperComponentAutoConfiguration {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(ZooKeeperComponentAutoConfiguration.class);
     @Autowired
+    private ApplicationContext applicationContext;
+    @Autowired
     private CamelContext camelContext;
+    @Autowired
+    private ZooKeeperComponentConfiguration configuration;
     @Autowired(required = false)
     private List<ComponentCustomizer<ZooKeeperComponent>> customizers;
-    @Autowired
-    private ComponentConfigurationProperties globalConfiguration;
-    @Autowired
-    private ZooKeeperComponentConfiguration componentConfiguration;
 
     static class GroupConditions extends GroupCondition {
         public GroupConditions() {
@@ -77,8 +80,8 @@ public class ZooKeeperComponentAutoConfiguration {
         ZooKeeperComponent component = new ZooKeeperComponent();
         component.setCamelContext(camelContext);
         Map<String, Object> parameters = new HashMap<>();
-        IntrospectionSupport.getProperties(componentConfiguration, parameters,
-                null, false);
+        IntrospectionSupport.getProperties(configuration, parameters, null,
+                false);
         for (Map.Entry<String, Object> entry : parameters.entrySet()) {
             Object value = entry.getValue();
             Class<?> paramClass = value.getClass();
@@ -101,14 +104,23 @@ public class ZooKeeperComponentAutoConfiguration {
         }
         IntrospectionSupport.setProperties(camelContext,
                 camelContext.getTypeConverter(), component, parameters);
-        boolean useCustomizers = globalConfiguration.getCustomizer()
-                .isEnabled()
-                && componentConfiguration.getCustomizer().isEnabled();
-        if (useCustomizers && ObjectHelper.isNotEmpty(customizers)) {
+        if (ObjectHelper.isNotEmpty(customizers)) {
             for (ComponentCustomizer<ZooKeeperComponent> customizer : customizers) {
-                LOGGER.debug("Configure component {}, with customizer {}",
-                        component, customizer);
-                customizer.customize(component);
+                boolean useCustomizer = (customizer instanceof HasId)
+                        ? HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.zookeeper.customizer",
+                                ((HasId) customizer).getId())
+                        : HierarchicalPropertiesEvaluator.evaluate(
+                                applicationContext.getEnvironment(),
+                                "camel.component.customizer",
+                                "camel.component.zookeeper.customizer");
+                if (useCustomizer) {
+                    LOGGER.debug("Configure component {}, with customizer {}",
+                            component, customizer);
+                    customizer.customize(component);
+                }
             }
         }
         return component;


Mime
View raw message