http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/binding/springboot/BindingNameComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/binding/springboot/BindingNameComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/binding/springboot/BindingNameComponentAutoConfiguration.java index d07f676..ce78eb1 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/binding/springboot/BindingNameComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/binding/springboot/BindingNameComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.binding.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.binding.BindingNameComponent; -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(BindingNameComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(BindingNameComponentConfiguration.class) public class BindingNameComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class BindingNameComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(BindingNameComponent.class) public BindingNameComponent configureBindingNameComponent( - CamelContext camelContext, - BindingNameComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { BindingNameComponent component = new BindingNameComponent(); 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-core-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java index db016c2..9aa85c0 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/browse/springboot/BrowseComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.browse.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.browse.BrowseComponent; -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(BrowseComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(BrowseComponentConfiguration.class) public class BrowseComponentAutoConfiguration { @Lazy @Bean(name = "browse-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(BrowseComponent.class) - public BrowseComponent configureBrowseComponent(CamelContext camelContext, - BrowseComponentConfiguration configuration) throws Exception { + public BrowseComponent configureBrowseComponent(CamelContext camelContext) + throws Exception { BrowseComponent component = new BrowseComponent(); 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-core-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java index d8ae2f9..d9a7aaa 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/controlbus/springboot/ControlBusComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.controlbus.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.controlbus.ControlBusComponent; -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(ControlBusComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(ControlBusComponentConfiguration.class) public class ControlBusComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class ControlBusComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ControlBusComponent.class) public ControlBusComponent configureControlBusComponent( - CamelContext camelContext, - ControlBusComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { ControlBusComponent component = new ControlBusComponent(); 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-core-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java index 169c9fa..c574bdc 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataformat/springboot/DataFormatComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.dataformat.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.dataformat.DataFormatComponent; -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(DataFormatComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(DataFormatComponentConfiguration.class) public class DataFormatComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class DataFormatComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DataFormatComponent.class) public DataFormatComponent configureDataFormatComponent( - CamelContext camelContext, - DataFormatComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { DataFormatComponent component = new DataFormatComponent(); 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-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java index 56fd9a3..e3d205c 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/dataset/springboot/DataSetComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.dataset.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.dataset.DataSetComponent; -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(DataSetComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(DataSetComponentConfiguration.class) public class DataSetComponentAutoConfiguration { @Lazy @Bean(name = "dataset-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DataSetComponent.class) - public DataSetComponent configureDataSetComponent( - CamelContext camelContext, - DataSetComponentConfiguration configuration) throws Exception { + public DataSetComponent configureDataSetComponent(CamelContext camelContext) + throws Exception { DataSetComponent component = new DataSetComponent(); 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-core-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java index d0a4dfe..8b82256 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/file/springboot/FileComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.file.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.file.FileComponent; -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(FileComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(FileComponentConfiguration.class) public class FileComponentAutoConfiguration { @Lazy @Bean(name = "file-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(FileComponent.class) - public FileComponent configureFileComponent(CamelContext camelContext, - FileComponentConfiguration configuration) throws Exception { + public FileComponent configureFileComponent(CamelContext camelContext) + throws Exception { FileComponent component = new FileComponent(); 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-core-starter/src/main/java/org/apache/camel/component/language/springboot/LanguageComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/language/springboot/LanguageComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/language/springboot/LanguageComponentAutoConfiguration.java index d51b768..a67110a 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/language/springboot/LanguageComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/language/springboot/LanguageComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.language.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.language.LanguageComponent; -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(LanguageComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(LanguageComponentConfiguration.class) public class LanguageComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class LanguageComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LanguageComponent.class) public LanguageComponent configureLanguageComponent( - CamelContext camelContext, - LanguageComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { LanguageComponent component = new LanguageComponent(); 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-core-starter/src/main/java/org/apache/camel/component/mock/springboot/MockComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/mock/springboot/MockComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/mock/springboot/MockComponentAutoConfiguration.java index c112563..73167f4 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/mock/springboot/MockComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/mock/springboot/MockComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.mock.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.mock.MockComponent; -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(MockComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(MockComponentConfiguration.class) public class MockComponentAutoConfiguration { @Lazy @Bean(name = "mock-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MockComponent.class) - public MockComponent configureMockComponent(CamelContext camelContext, - MockComponentConfiguration configuration) throws Exception { + public MockComponent configureMockComponent(CamelContext camelContext) + throws Exception { MockComponent component = new MockComponent(); 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-core-starter/src/main/java/org/apache/camel/component/ref/springboot/RefComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/ref/springboot/RefComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/ref/springboot/RefComponentAutoConfiguration.java index a02fd89..c30907a 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/ref/springboot/RefComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/ref/springboot/RefComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.ref.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.ref.RefComponent; -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(RefComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(RefComponentConfiguration.class) public class RefComponentAutoConfiguration { @Lazy @Bean(name = "ref-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RefComponent.class) - public RefComponent configureRefComponent(CamelContext camelContext, - RefComponentConfiguration configuration) throws Exception { + public RefComponent configureRefComponent(CamelContext camelContext) + throws Exception { RefComponent component = new RefComponent(); 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-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestApiComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestApiComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestApiComponentAutoConfiguration.java index b345085..2567fb7 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestApiComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/rest/springboot/RestApiComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.rest.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.rest.RestApiComponent; -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(RestApiComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(RestApiComponentConfiguration.class) public class RestApiComponentAutoConfiguration { @Lazy @Bean(name = "rest-api-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RestApiComponent.class) - public RestApiComponent configureRestApiComponent( - CamelContext camelContext, - RestApiComponentConfiguration configuration) throws Exception { + public RestApiComponent configureRestApiComponent(CamelContext camelContext) + throws Exception { RestApiComponent component = new RestApiComponent(); 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-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java index 11017c4..fe4f022 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/test/springboot/TestComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.test.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.test.TestComponent; -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(TestComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(TestComponentConfiguration.class) public class TestComponentAutoConfiguration { @Lazy @Bean(name = "test-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(TestComponent.class) - public TestComponent configureTestComponent(CamelContext camelContext, - TestComponentConfiguration configuration) throws Exception { + public TestComponent configureTestComponent(CamelContext camelContext) + throws Exception { TestComponent component = new TestComponent(); 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-core-starter/src/main/java/org/apache/camel/component/timer/springboot/TimerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/timer/springboot/TimerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/timer/springboot/TimerComponentAutoConfiguration.java index d81efb4..e65f565 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/timer/springboot/TimerComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/timer/springboot/TimerComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.timer.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.timer.TimerComponent; -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(TimerComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(TimerComponentConfiguration.class) public class TimerComponentAutoConfiguration { @Lazy @Bean(name = "timer-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(TimerComponent.class) - public TimerComponent configureTimerComponent(CamelContext camelContext, - TimerComponentConfiguration configuration) throws Exception { + public TimerComponent configureTimerComponent(CamelContext camelContext) + throws Exception { TimerComponent component = new TimerComponent(); 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-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java index 9f43c09..e9bdd3b 100644 --- a/platforms/spring-boot/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.couchbase.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.couchbase.CouchbaseComponent; -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(CouchbaseComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(CouchbaseComponentConfiguration.class) public class CouchbaseComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class CouchbaseComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CouchbaseComponent.class) public CouchbaseComponent configureCouchbaseComponent( - CamelContext camelContext, - CouchbaseComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { CouchbaseComponent component = new CouchbaseComponent(); 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-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java index d9adbd2..e5ebbc6 100644 --- a/platforms/spring-boot/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-couchdb-starter/src/main/java/org/apache/camel/component/couchdb/springboot/CouchDbComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.couchdb.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.couchdb.CouchDbComponent; -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(CouchDbComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(CouchDbComponentConfiguration.class) public class CouchDbComponentAutoConfiguration { @Lazy @Bean(name = "couchdb-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CouchDbComponent.class) - public CouchDbComponent configureCouchDbComponent( - CamelContext camelContext, - CouchDbComponentConfiguration configuration) throws Exception { + public CouchDbComponent configureCouchDbComponent(CamelContext camelContext) + throws Exception { CouchDbComponent component = new CouchDbComponent(); 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-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java index afa2dbe..5925f5e 100644 --- a/platforms/spring-boot/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-dns-starter/src/main/java/org/apache/camel/component/dns/springboot/DnsComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.dns.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.dns.DnsComponent; -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(DnsComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(DnsComponentConfiguration.class) public class DnsComponentAutoConfiguration { @Lazy @Bean(name = "dns-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DnsComponent.class) - public DnsComponent configureDnsComponent(CamelContext camelContext, - DnsComponentConfiguration configuration) throws Exception { + public DnsComponent configureDnsComponent(CamelContext camelContext) + throws Exception { DnsComponent component = new DnsComponent(); 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-dozer-starter/src/main/java/org/apache/camel/component/dozer/springboot/DozerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-dozer-starter/src/main/java/org/apache/camel/component/dozer/springboot/DozerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-dozer-starter/src/main/java/org/apache/camel/component/dozer/springboot/DozerComponentAutoConfiguration.java index cd1f2df..df0348d 100644 --- a/platforms/spring-boot/components-starter/camel-dozer-starter/src/main/java/org/apache/camel/component/dozer/springboot/DozerComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-dozer-starter/src/main/java/org/apache/camel/component/dozer/springboot/DozerComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.dozer.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.dozer.DozerComponent; -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(DozerComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(DozerComponentConfiguration.class) public class DozerComponentAutoConfiguration { @Lazy @Bean(name = "dozer-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DozerComponent.class) - public DozerComponent configureDozerComponent(CamelContext camelContext, - DozerComponentConfiguration configuration) throws Exception { + public DozerComponent configureDozerComponent(CamelContext camelContext) + throws Exception { DozerComponent component = new DozerComponent(); 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-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java index 02e47f2..fdfdc09 100644 --- a/platforms/spring-boot/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-drill-starter/src/main/java/org/apache/camel/component/drill/springboot/DrillComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.drill.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.drill.DrillComponent; -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(DrillComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(DrillComponentConfiguration.class) public class DrillComponentAutoConfiguration { @Lazy @Bean(name = "drill-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DrillComponent.class) - public DrillComponent configureDrillComponent(CamelContext camelContext, - DrillComponentConfiguration configuration) throws Exception { + public DrillComponent configureDrillComponent(CamelContext camelContext) + throws Exception { DrillComponent component = new DrillComponent(); 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-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java index 589966a..53b7c8a 100644 --- a/platforms/spring-boot/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-dropbox-starter/src/main/java/org/apache/camel/component/dropbox/springboot/DropboxComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.dropbox.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.dropbox.DropboxComponent; -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(DropboxComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(DropboxComponentConfiguration.class) public class DropboxComponentAutoConfiguration { @Lazy @Bean(name = "dropbox-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DropboxComponent.class) - public DropboxComponent configureDropboxComponent( - CamelContext camelContext, - DropboxComponentConfiguration configuration) throws Exception { + public DropboxComponent configureDropboxComponent(CamelContext camelContext) + throws Exception { DropboxComponent component = new DropboxComponent(); 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-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java index 9221921..00e8355 100644 --- a/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-ehcache-starter/src/main/java/org/apache/camel/component/ehcache/springboot/EhcacheComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.ehcache.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.ehcache.EhcacheComponent; -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(EhcacheComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(EhcacheComponentConfiguration.class) public class EhcacheComponentAutoConfiguration { @Lazy @Bean(name = "ehcache-component") @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(EhcacheComponent.class) - public EhcacheComponent configureEhcacheComponent( - CamelContext camelContext, - EhcacheComponentConfiguration configuration) throws Exception { + public EhcacheComponent configureEhcacheComponent(CamelContext camelContext) + throws Exception { EhcacheComponent component = new EhcacheComponent(); 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-elasticsearch5-starter/src/main/java/org/apache/camel/component/elasticsearch5/springboot/ElasticsearchComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-elasticsearch5-starter/src/main/java/org/apache/camel/component/elasticsearch5/springboot/ElasticsearchComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-elasticsearch5-starter/src/main/java/org/apache/camel/component/elasticsearch5/springboot/ElasticsearchComponentAutoConfiguration.java index 0edc75e..3e9a70b 100644 --- a/platforms/spring-boot/components-starter/camel-elasticsearch5-starter/src/main/java/org/apache/camel/component/elasticsearch5/springboot/ElasticsearchComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-elasticsearch5-starter/src/main/java/org/apache/camel/component/elasticsearch5/springboot/ElasticsearchComponentAutoConfiguration.java @@ -16,11 +16,8 @@ */ package org.apache.camel.component.elasticsearch5.springboot; -import java.util.HashMap; -import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.component.elasticsearch5.ElasticsearchComponent; -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(ElasticsearchComponentAutoConfiguration.Condition.class) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") -@EnableConfigurationProperties(ElasticsearchComponentConfiguration.class) public class ElasticsearchComponentAutoConfiguration { @Lazy @@ -52,35 +47,9 @@ public class ElasticsearchComponentAutoConfiguration { @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ElasticsearchComponent.class) public ElasticsearchComponent configureElasticsearchComponent( - CamelContext camelContext, - ElasticsearchComponentConfiguration configuration) throws Exception { + CamelContext camelContext) throws Exception { ElasticsearchComponent component = new ElasticsearchComponent(); 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; }