You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/03/04 14:57:48 UTC
[6/8] camel git commit: CAMEL-10937: Camel components - Configured
using setters should support property placeholders
http://git-wip-us.apache.org/repos/asf/camel/blob/bf1b57ca/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/kinesis/springboot/KinesisComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/kinesis/springboot/KinesisComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/kinesis/springboot/KinesisComponentAutoConfiguration.java
index ad59fe7..402f43d 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/kinesis/springboot/KinesisComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/kinesis/springboot/KinesisComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.aws.kinesis.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.aws.kinesis.KinesisComponent;
-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(KinesisComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(KinesisComponentConfiguration.class)
public class KinesisComponentAutoConfiguration {
@Lazy
@Bean(name = "aws-kinesis-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(KinesisComponent.class)
- public KinesisComponent configureKinesisComponent(
- CamelContext camelContext,
- KinesisComponentConfiguration configuration) throws Exception {
+ public KinesisComponent configureKinesisComponent(CamelContext camelContext)
+ throws Exception {
KinesisComponent component = new KinesisComponent();
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-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentAutoConfiguration.java
index b6c616c..192ebf0 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/s3/springboot/S3ComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.aws.s3.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.aws.s3.S3Component;
-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(S3ComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(S3ComponentConfiguration.class)
public class S3ComponentAutoConfiguration {
@Lazy
@Bean(name = "aws-s3-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(S3Component.class)
- public S3Component configureS3Component(CamelContext camelContext,
- S3ComponentConfiguration configuration) throws Exception {
+ public S3Component configureS3Component(CamelContext camelContext)
+ throws Exception {
S3Component component = new S3Component();
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-aws-starter/src/main/java/org/apache/camel/component/aws/sdb/springboot/SdbComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sdb/springboot/SdbComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sdb/springboot/SdbComponentAutoConfiguration.java
index bf4212c..784b48d 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sdb/springboot/SdbComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sdb/springboot/SdbComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.aws.sdb.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.aws.sdb.SdbComponent;
-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(SdbComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(SdbComponentConfiguration.class)
public class SdbComponentAutoConfiguration {
@Lazy
@Bean(name = "aws-sdb-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SdbComponent.class)
- public SdbComponent configureSdbComponent(CamelContext camelContext,
- SdbComponentConfiguration configuration) throws Exception {
+ public SdbComponent configureSdbComponent(CamelContext camelContext)
+ throws Exception {
SdbComponent component = new SdbComponent();
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-aws-starter/src/main/java/org/apache/camel/component/aws/ses/springboot/SesComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ses/springboot/SesComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ses/springboot/SesComponentAutoConfiguration.java
index 1c6b179..da577b8 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ses/springboot/SesComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/ses/springboot/SesComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.aws.ses.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.aws.ses.SesComponent;
-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(SesComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(SesComponentConfiguration.class)
public class SesComponentAutoConfiguration {
@Lazy
@Bean(name = "aws-ses-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SesComponent.class)
- public SesComponent configureSesComponent(CamelContext camelContext,
- SesComponentConfiguration configuration) throws Exception {
+ public SesComponent configureSesComponent(CamelContext camelContext)
+ throws Exception {
SesComponent component = new SesComponent();
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-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentAutoConfiguration.java
index e611d9c..3a89352 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sns/springboot/SnsComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.aws.sns.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.aws.sns.SnsComponent;
-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(SnsComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(SnsComponentConfiguration.class)
public class SnsComponentAutoConfiguration {
@Lazy
@Bean(name = "aws-sns-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SnsComponent.class)
- public SnsComponent configureSnsComponent(CamelContext camelContext,
- SnsComponentConfiguration configuration) throws Exception {
+ public SnsComponent configureSnsComponent(CamelContext camelContext)
+ throws Exception {
SnsComponent component = new SnsComponent();
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-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentAutoConfiguration.java
index cfdbb4a..d898529 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/sqs/springboot/SqsComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.aws.sqs.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.aws.sqs.SqsComponent;
-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(SqsComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(SqsComponentConfiguration.class)
public class SqsComponentAutoConfiguration {
@Lazy
@Bean(name = "aws-sqs-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SqsComponent.class)
- public SqsComponent configureSqsComponent(CamelContext camelContext,
- SqsComponentConfiguration configuration) throws Exception {
+ public SqsComponent configureSqsComponent(CamelContext camelContext)
+ throws Exception {
SqsComponent component = new SqsComponent();
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-aws-starter/src/main/java/org/apache/camel/component/aws/swf/springboot/SWFComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/swf/springboot/SWFComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/swf/springboot/SWFComponentAutoConfiguration.java
index 39ce90e..41c5993 100644
--- a/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/swf/springboot/SWFComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-aws-starter/src/main/java/org/apache/camel/component/aws/swf/springboot/SWFComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.aws.swf.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.aws.swf.SWFComponent;
-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(SWFComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(SWFComponentConfiguration.class)
public class SWFComponentAutoConfiguration {
@Lazy
@Bean(name = "aws-swf-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SWFComponent.class)
- public SWFComponent configureSWFComponent(CamelContext camelContext,
- SWFComponentConfiguration configuration) throws Exception {
+ public SWFComponent configureSWFComponent(CamelContext camelContext)
+ throws Exception {
SWFComponent component = new SWFComponent();
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-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java
index 322d96d..fdb4dfc 100644
--- a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/blob/springboot/BlobServiceComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.azure.blob.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.azure.blob.BlobServiceComponent;
-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(BlobServiceComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(BlobServiceComponentConfiguration.class)
public class BlobServiceComponentAutoConfiguration {
@Lazy
@@ -52,35 +47,9 @@ public class BlobServiceComponentAutoConfiguration {
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BlobServiceComponent.class)
public BlobServiceComponent configureBlobServiceComponent(
- CamelContext camelContext,
- BlobServiceComponentConfiguration configuration) throws Exception {
+ CamelContext camelContext) throws Exception {
BlobServiceComponent component = new BlobServiceComponent();
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-azure-starter/src/main/java/org/apache/camel/component/azure/queue/springboot/QueueServiceComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/queue/springboot/QueueServiceComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/queue/springboot/QueueServiceComponentAutoConfiguration.java
index e884610..a929af0 100644
--- a/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/queue/springboot/QueueServiceComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-azure-starter/src/main/java/org/apache/camel/component/azure/queue/springboot/QueueServiceComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.azure.queue.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.azure.queue.QueueServiceComponent;
-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(QueueServiceComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(QueueServiceComponentConfiguration.class)
public class QueueServiceComponentAutoConfiguration {
@Lazy
@@ -52,35 +47,9 @@ public class QueueServiceComponentAutoConfiguration {
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(QueueServiceComponent.class)
public QueueServiceComponent configureQueueServiceComponent(
- CamelContext camelContext,
- QueueServiceComponentConfiguration configuration) throws Exception {
+ CamelContext camelContext) throws Exception {
QueueServiceComponent component = new QueueServiceComponent();
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-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java
index 5114926..2aef002 100644
--- a/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-bean-validator-starter/src/main/java/org/apache/camel/component/bean/validator/springboot/BeanValidatorComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.bean.validator.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.bean.validator.BeanValidatorComponent;
-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(BeanValidatorComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(BeanValidatorComponentConfiguration.class)
public class BeanValidatorComponentAutoConfiguration {
@Lazy
@@ -52,35 +47,9 @@ public class BeanValidatorComponentAutoConfiguration {
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BeanValidatorComponent.class)
public BeanValidatorComponent configureBeanValidatorComponent(
- CamelContext camelContext,
- BeanValidatorComponentConfiguration configuration) throws Exception {
+ CamelContext camelContext) throws Exception {
BeanValidatorComponent component = new BeanValidatorComponent();
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-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java
index 17e7bab..776f6b2 100644
--- a/platforms/spring-boot/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-bonita-starter/src/main/java/org/apache/camel/component/bonita/springboot/BonitaComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.bonita.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.bonita.BonitaComponent;
-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(BonitaComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(BonitaComponentConfiguration.class)
public class BonitaComponentAutoConfiguration {
@Lazy
@Bean(name = "bonita-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BonitaComponent.class)
- public BonitaComponent configureBonitaComponent(CamelContext camelContext,
- BonitaComponentConfiguration configuration) throws Exception {
+ public BonitaComponent configureBonitaComponent(CamelContext camelContext)
+ throws Exception {
BonitaComponent component = new BonitaComponent();
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-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java
index f7bc27a..40cb722 100644
--- a/platforms/spring-boot/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-cassandraql-starter/src/main/java/org/apache/camel/component/cassandra/springboot/CassandraComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.cassandra.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.cassandra.CassandraComponent;
-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(CassandraComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(CassandraComponentConfiguration.class)
public class CassandraComponentAutoConfiguration {
@Lazy
@@ -52,35 +47,9 @@ public class CassandraComponentAutoConfiguration {
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(CassandraComponent.class)
public CassandraComponent configureCassandraComponent(
- CamelContext camelContext,
- CassandraComponentConfiguration configuration) throws Exception {
+ CamelContext camelContext) throws Exception {
CassandraComponent component = new CassandraComponent();
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-chronicle-starter/src/main/java/org/apache/camel/component/chronicle/engine/springboot/ChronicleEngineComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-chronicle-starter/src/main/java/org/apache/camel/component/chronicle/engine/springboot/ChronicleEngineComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-chronicle-starter/src/main/java/org/apache/camel/component/chronicle/engine/springboot/ChronicleEngineComponentAutoConfiguration.java
index fbf17c3..416b32f 100644
--- a/platforms/spring-boot/components-starter/camel-chronicle-starter/src/main/java/org/apache/camel/component/chronicle/engine/springboot/ChronicleEngineComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-chronicle-starter/src/main/java/org/apache/camel/component/chronicle/engine/springboot/ChronicleEngineComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.chronicle.engine.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.chronicle.engine.ChronicleEngineComponent;
-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(ChronicleEngineComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(ChronicleEngineComponentConfiguration.class)
public class ChronicleEngineComponentAutoConfiguration {
@Lazy
@@ -52,36 +47,9 @@ public class ChronicleEngineComponentAutoConfiguration {
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(ChronicleEngineComponent.class)
public ChronicleEngineComponent configureChronicleEngineComponent(
- CamelContext camelContext,
- ChronicleEngineComponentConfiguration configuration)
- throws Exception {
+ CamelContext camelContext) throws Exception {
ChronicleEngineComponent component = new ChronicleEngineComponent();
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-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java
index 22cca23..76a5ef4 100644
--- a/platforms/spring-boot/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-chunk-starter/src/main/java/org/apache/camel/component/chunk/springboot/ChunkComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.chunk.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.chunk.ChunkComponent;
-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(ChunkComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(ChunkComponentConfiguration.class)
public class ChunkComponentAutoConfiguration {
@Lazy
@Bean(name = "chunk-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(ChunkComponent.class)
- public ChunkComponent configureChunkComponent(CamelContext camelContext,
- ChunkComponentConfiguration configuration) throws Exception {
+ public ChunkComponent configureChunkComponent(CamelContext camelContext)
+ throws Exception {
ChunkComponent component = new ChunkComponent();
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-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java
index dca4936..96f44e6 100644
--- a/platforms/spring-boot/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-cm-sms-starter/src/main/java/org/apache/camel/component/cm/springboot/CMComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.cm.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.cm.CMComponent;
-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(CMComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(CMComponentConfiguration.class)
public class CMComponentAutoConfiguration {
@Lazy
@Bean(name = "cm-sms-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(CMComponent.class)
- public CMComponent configureCMComponent(CamelContext camelContext,
- CMComponentConfiguration configuration) throws Exception {
+ public CMComponent configureCMComponent(CamelContext camelContext)
+ throws Exception {
CMComponent component = new CMComponent();
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-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java
index c90c676..30eb83c 100644
--- a/platforms/spring-boot/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-coap-starter/src/main/java/org/apache/camel/coap/springboot/CoAPComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.coap.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.coap.CoAPComponent;
-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(CoAPComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(CoAPComponentConfiguration.class)
public class CoAPComponentAutoConfiguration {
@Lazy
@Bean(name = "coap-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(CoAPComponent.class)
- public CoAPComponent configureCoAPComponent(CamelContext camelContext,
- CoAPComponentConfiguration configuration) throws Exception {
+ public CoAPComponent configureCoAPComponent(CamelContext camelContext)
+ throws Exception {
CoAPComponent component = new CoAPComponent();
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-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java
index cd7fbbf..1ddca31 100644
--- a/platforms/spring-boot/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-consul-starter/src/main/java/org/apache/camel/component/consul/springboot/ConsulComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.consul.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.consul.ConsulComponent;
-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(ConsulComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(ConsulComponentConfiguration.class)
public class ConsulComponentAutoConfiguration {
@Lazy
@Bean(name = "consul-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(ConsulComponent.class)
- public ConsulComponent configureConsulComponent(CamelContext camelContext,
- ConsulComponentConfiguration configuration) throws Exception {
+ public ConsulComponent configureConsulComponent(CamelContext camelContext)
+ throws Exception {
ConsulComponent component = new ConsulComponent();
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-context-starter/src/main/java/org/apache/camel/component/context/springboot/QualifiedContextComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-context-starter/src/main/java/org/apache/camel/component/context/springboot/QualifiedContextComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-context-starter/src/main/java/org/apache/camel/component/context/springboot/QualifiedContextComponentAutoConfiguration.java
index 85ca848..c1ac8a6 100644
--- a/platforms/spring-boot/components-starter/camel-context-starter/src/main/java/org/apache/camel/component/context/springboot/QualifiedContextComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-context-starter/src/main/java/org/apache/camel/component/context/springboot/QualifiedContextComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.context.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.context.QualifiedContextComponent;
-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(QualifiedContextComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(QualifiedContextComponentConfiguration.class)
public class QualifiedContextComponentAutoConfiguration {
@Lazy
@@ -52,36 +47,9 @@ public class QualifiedContextComponentAutoConfiguration {
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(QualifiedContextComponent.class)
public QualifiedContextComponent configureQualifiedContextComponent(
- CamelContext camelContext,
- QualifiedContextComponentConfiguration configuration)
- throws Exception {
+ CamelContext camelContext) throws Exception {
QualifiedContextComponent component = new QualifiedContextComponent();
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/bean/springboot/BeanComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java
index 87305ee..53abd7e 100644
--- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/bean/springboot/BeanComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.bean.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.bean.BeanComponent;
-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(BeanComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(BeanComponentConfiguration.class)
public class BeanComponentAutoConfiguration {
@Lazy
@Bean(name = "bean-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BeanComponent.class)
- public BeanComponent configureBeanComponent(CamelContext camelContext,
- BeanComponentConfiguration configuration) throws Exception {
+ public BeanComponent configureBeanComponent(CamelContext camelContext)
+ throws Exception {
BeanComponent component = new BeanComponent();
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/beanclass/springboot/ClassComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java
index 24dfb36..d75da6f 100644
--- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/component/beanclass/springboot/ClassComponentAutoConfiguration.java
@@ -16,11 +16,8 @@
*/
package org.apache.camel.component.beanclass.springboot;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.component.beanclass.ClassComponent;
-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(ClassComponentAutoConfiguration.Condition.class)
@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
-@EnableConfigurationProperties(ClassComponentConfiguration.class)
public class ClassComponentAutoConfiguration {
@Lazy
@Bean(name = "class-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(ClassComponent.class)
- public ClassComponent configureClassComponent(CamelContext camelContext,
- ClassComponentConfiguration configuration) throws Exception {
+ public ClassComponent configureClassComponent(CamelContext camelContext)
+ throws Exception {
ClassComponent component = new ClassComponent();
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;
}