http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JIRAComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JIRAComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JIRAComponentAutoConfiguration.java index 24d5696..a40a8c1 100644 --- a/platforms/spring-boot/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JIRAComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-jira-starter/src/main/java/org/apache/camel/component/jira/springboot/JIRAComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.jira.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.jira.JIRAComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(JIRAComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(JIRAComponentConfiguration.class) public class JIRAComponentAutoConfiguration { @Lazy @Bean(name = "jira-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JIRAComponent.class) - public JIRAComponent configureJIRAComponent(CamelContext camelContext, - JIRAComponentConfiguration configuration) throws Exception { + public JIRAComponent configureJIRAComponent(CamelContext camelContext) + throws Exception { JIRAComponent component = new JIRAComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; }
http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java index e140a2d..2230be6 100644 --- a/platforms/spring-boot/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-jmx-starter/src/main/java/org/apache/camel/component/jmx/springboot/JMXComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.jmx.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.jmx.JMXComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(JMXComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(JMXComponentConfiguration.class) public class JMXComponentAutoConfiguration { @Lazy @Bean(name = "jmx-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(JMXComponent.class) - public JMXComponent configureJMXComponent(CamelContext camelContext, - JMXComponentConfiguration configuration) throws Exception { + public JMXComponent configureJMXComponent(CamelContext camelContext) + throws Exception { JMXComponent component = new JMXComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java index 7644da8..9930712 100644 --- a/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.krati.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.krati.KratiComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(KratiComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(KratiComponentConfiguration.class) public class KratiComponentAutoConfiguration { @Lazy @Bean(name = "krati-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(KratiComponent.class) - public KratiComponent configureKratiComponent(CamelContext camelContext, - KratiComponentConfiguration configuration) throws Exception { + public KratiComponent configureKratiComponent(CamelContext camelContext) + throws Exception { KratiComponent component = new KratiComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java index 13f802a..c3b5545 100644 --- a/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.kubernetes.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.kubernetes.KubernetesComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(KubernetesComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(KubernetesComponentConfiguration.class) public class KubernetesComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class KubernetesComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(KubernetesComponent.class) public KubernetesComponent configureKubernetesComponent( - CamelContext camelContext, - KubernetesComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { KubernetesComponent component = new KubernetesComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java index 797f03b..9a541be 100644 --- a/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.ldap.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.ldap.LdapComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(LdapComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(LdapComponentConfiguration.class) public class LdapComponentAutoConfiguration { @Lazy @Bean(name = "ldap-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LdapComponent.class) - public LdapComponent configureLdapComponent(CamelContext camelContext, - LdapComponentConfiguration configuration) throws Exception { + public LdapComponent configureLdapComponent(CamelContext camelContext) + throws Exception { LdapComponent component = new LdapComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java index be286a1..1386dd4 100644 --- a/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.mllp.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.mllp.MllpComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(MllpComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(MllpComponentConfiguration.class) public class MllpComponentAutoConfiguration { @Lazy @Bean(name = "mllp-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MllpComponent.class) - public MllpComponent configureMllpComponent(CamelContext camelContext, - MllpComponentConfiguration configuration) throws Exception { + public MllpComponent configureMllpComponent(CamelContext camelContext) + throws Exception { MllpComponent component = new MllpComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java index a55b690..4ee9881 100644 --- a/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.mongodb.gridfs.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.mongodb.gridfs.GridFsComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(GridFsComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(GridFsComponentConfiguration.class) public class GridFsComponentAutoConfiguration { @Lazy @Bean(name = "mongodb-gridfs-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GridFsComponent.class) - public GridFsComponent configureGridFsComponent(CamelContext camelContext, - GridFsComponentConfiguration configuration) throws Exception { + public GridFsComponent configureGridFsComponent(CamelContext camelContext) + throws Exception { GridFsComponent component = new GridFsComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java index f69e46e..aa68ff1 100644 --- a/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.mongodb.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.mongodb.MongoDbComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,43 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(MongoDbComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(MongoDbComponentConfiguration.class) public class MongoDbComponentAutoConfiguration { @Lazy @Bean(name = "mongodb-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MongoDbComponent.class) - public MongoDbComponent configureMongoDbComponent( - CamelContext camelContext, - MongoDbComponentConfiguration configuration) throws Exception { + public MongoDbComponent configureMongoDbComponent(CamelContext camelContext) + throws Exception { MongoDbComponent component = new MongoDbComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java index 058f884..38f7dc7 100644 --- a/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.mongodb3.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.mongodb3.MongoDbComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,43 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(MongoDbComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(MongoDbComponentConfiguration.class) public class MongoDbComponentAutoConfiguration { @Lazy @Bean(name = "mongodb3-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MongoDbComponent.class) - public MongoDbComponent configureMongoDbComponent( - CamelContext camelContext, - MongoDbComponentConfiguration configuration) throws Exception { + public MongoDbComponent configureMongoDbComponent(CamelContext camelContext) + throws Exception { MongoDbComponent component = new MongoDbComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java index 611ce35..9761226 100644 --- a/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.mvel.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.mvel.MvelComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(MvelComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(MvelComponentConfiguration.class) public class MvelComponentAutoConfiguration { @Lazy @Bean(name = "mvel-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MvelComponent.class) - public MvelComponent configureMvelComponent(CamelContext camelContext, - MvelComponentConfiguration configuration) throws Exception { + public MvelComponent configureMvelComponent(CamelContext camelContext) + throws Exception { MvelComponent component = new MvelComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-nats-starter/src/main/java/org/apache/camel/component/nats/springboot/NatsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-nats-starter/src/main/java/org/apache/camel/component/nats/springboot/NatsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-nats-starter/src/main/java/org/apache/camel/component/nats/springboot/NatsComponentAutoConfiguration.java index 52780ce..d77dd5d 100644 --- a/platforms/spring-boot/components-starter/camel-nats-starter/src/main/java/org/apache/camel/component/nats/springboot/NatsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-nats-starter/src/main/java/org/apache/camel/component/nats/springboot/NatsComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.nats.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.nats.NatsComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(NatsComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(NatsComponentConfiguration.class) public class NatsComponentAutoConfiguration { @Lazy @Bean(name = "nats-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(NatsComponent.class) - public NatsComponent configureNatsComponent(CamelContext camelContext, - NatsComponentConfiguration configuration) throws Exception { + public NatsComponent configureNatsComponent(CamelContext camelContext) + throws Exception { NatsComponent component = new NatsComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java index fba9a86..4defed1 100644 --- a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/cinder/springboot/CinderComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.openstack.cinder.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.openstack.cinder.CinderComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(CinderComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(CinderComponentConfiguration.class) public class CinderComponentAutoConfiguration { @Lazy @Bean(name = "openstack-cinder-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CinderComponent.class) - public CinderComponent configureCinderComponent(CamelContext camelContext, - CinderComponentConfiguration configuration) throws Exception { + public CinderComponent configureCinderComponent(CamelContext camelContext) + throws Exception { CinderComponent component = new CinderComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java index 1212d48..a404e64 100644 --- a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/glance/springboot/GlanceComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.openstack.glance.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.openstack.glance.GlanceComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(GlanceComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(GlanceComponentConfiguration.class) public class GlanceComponentAutoConfiguration { @Lazy @Bean(name = "openstack-glance-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GlanceComponent.class) - public GlanceComponent configureGlanceComponent(CamelContext camelContext, - GlanceComponentConfiguration configuration) throws Exception { + public GlanceComponent configureGlanceComponent(CamelContext camelContext) + throws Exception { GlanceComponent component = new GlanceComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java index 11f007d..ac5053e 100644 --- a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/keystone/springboot/KeystoneComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.openstack.keystone.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.openstack.keystone.KeystoneComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(KeystoneComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(KeystoneComponentConfiguration.class) public class KeystoneComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class KeystoneComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(KeystoneComponent.class) public KeystoneComponent configureKeystoneComponent( - CamelContext camelContext, - KeystoneComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { KeystoneComponent component = new KeystoneComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java index f84785e..8d9d54c 100644 --- a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/neutron/springboot/NeutronComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.openstack.neutron.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.openstack.neutron.NeutronComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,43 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(NeutronComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(NeutronComponentConfiguration.class) public class NeutronComponentAutoConfiguration { @Lazy @Bean(name = "openstack-neutron-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(NeutronComponent.class) - public NeutronComponent configureNeutronComponent( - CamelContext camelContext, - NeutronComponentConfiguration configuration) throws Exception { + public NeutronComponent configureNeutronComponent(CamelContext camelContext) + throws Exception { NeutronComponent component = new NeutronComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java index 8192546..59f6f9a 100644 --- a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/nova/springboot/NovaComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.openstack.nova.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.openstack.nova.NovaComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(NovaComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(NovaComponentConfiguration.class) public class NovaComponentAutoConfiguration { @Lazy @Bean(name = "openstack-nova-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(NovaComponent.class) - public NovaComponent configureNovaComponent(CamelContext camelContext, - NovaComponentConfiguration configuration) throws Exception { + public NovaComponent configureNovaComponent(CamelContext camelContext) + throws Exception { NovaComponent component = new NovaComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/swift/springboot/SwiftComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/swift/springboot/SwiftComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/swift/springboot/SwiftComponentAutoConfiguration.java index 62b6b0b..2a21ed9 100644 --- a/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/swift/springboot/SwiftComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-openstack-starter/src/main/java/org/apache/camel/component/openstack/swift/springboot/SwiftComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.openstack.swift.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.openstack.swift.SwiftComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(SwiftComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(SwiftComponentConfiguration.class) public class SwiftComponentAutoConfiguration { @Lazy @Bean(name = "openstack-swift-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SwiftComponent.class) - public SwiftComponent configureSwiftComponent(CamelContext camelContext, - SwiftComponentConfiguration configuration) throws Exception { + public SwiftComponent configureSwiftComponent(CamelContext camelContext) + throws Exception { SwiftComponent component = new SwiftComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-optaplanner-starter/src/main/java/org/apache/camel/component/optaplanner/springboot/OptaPlannerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-optaplanner-starter/src/main/java/org/apache/camel/component/optaplanner/springboot/OptaPlannerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-optaplanner-starter/src/main/java/org/apache/camel/component/optaplanner/springboot/OptaPlannerComponentAutoConfiguration.java index 9ee5ca3..62047ab 100644 --- a/platforms/spring-boot/components-starter/camel-optaplanner-starter/src/main/java/org/apache/camel/component/optaplanner/springboot/OptaPlannerComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-optaplanner-starter/src/main/java/org/apache/camel/component/optaplanner/springboot/OptaPlannerComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.optaplanner.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.optaplanner.OptaPlannerComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,7 +40,6 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(OptaPlannerComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(OptaPlannerComponentConfiguration.class) public class OptaPlannerComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class OptaPlannerComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(OptaPlannerComponent.class) public OptaPlannerComponent configureOptaPlannerComponent( - CamelContext camelContext, - OptaPlannerComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { OptaPlannerComponent component = new OptaPlannerComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java index 42ef464..8076b67 100644 --- a/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.pdf.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.pdf.PdfComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,42 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(PdfComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(PdfComponentConfiguration.class) public class PdfComponentAutoConfiguration { @Lazy @Bean(name = "pdf-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PdfComponent.class) - public PdfComponent configurePdfComponent(CamelContext camelContext, - PdfComponentConfiguration configuration) throws Exception { + public PdfComponent configurePdfComponent(CamelContext camelContext) + throws Exception { PdfComponent component = new PdfComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; } http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java index b531376..7314c24 100644 --- a/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.pgevent.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.pgevent.PgEventComponent; -import org.apache.camel.util.IntrospectionSupport; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; @@ -29,7 +26,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.boot.bind.RelaxedPropertyResolver; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; @@ -44,43 +40,16 @@ import org.springframework.core.type.AnnotatedTypeMetadata; @ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration") @Conditional(PgEventComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(PgEventComponentConfiguration.class) public class PgEventComponentAutoConfiguration { @Lazy @Bean(name = "pgevent-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PgEventComponent.class) - public PgEventComponent configurePgEventComponent( - CamelContext camelContext, - PgEventComponentConfiguration configuration) throws Exception { + public PgEventComponent configurePgEventComponent(CamelContext camelContext) + throws Exception { PgEventComponent component = new PgEventComponent(); component.setCamelContext(camelContext); - Map<String, Object> parameters = new HashMap<>(); - IntrospectionSupport.getProperties(configuration, parameters, null, - false); - for (Map.Entry<String, Object> entry : parameters.entrySet()) { - Object value = entry.getValue(); - Class<?> paramClass = value.getClass(); - if (paramClass.getName().endsWith("NestedConfiguration")) { - Class nestedClass = null; - try { - nestedClass = (Class) paramClass.getDeclaredField( - "CAMEL_NESTED_CLASS").get(null); - HashMap<String, Object> nestedParameters = new HashMap<>(); - IntrospectionSupport.getProperties(value, nestedParameters, - null, false); - Object nestedProperty = nestedClass.newInstance(); - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), nestedProperty, - nestedParameters); - entry.setValue(nestedProperty); - } catch (NoSuchFieldException e) { - } - } - } - IntrospectionSupport.setProperties(camelContext, - camelContext.getTypeConverter(), component, parameters); return component; }