camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hekon...@apache.org
Subject camel git commit: [Spring Boot] Added camel.springboot.typeConverter property.
Date Mon, 05 Jan 2015 17:57:36 GMT
Repository: camel
Updated Branches:
  refs/heads/master e64a8d1e6 -> dd202bc24


[Spring Boot] Added camel.springboot.typeConverter property.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dd202bc2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dd202bc2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dd202bc2

Branch: refs/heads/master
Commit: dd202bc2457678a1bff8805f64f494ea4d07d24a
Parents: e64a8d1
Author: Henryk Konsek <hekonsek@gmail.com>
Authored: Mon Jan 5 18:57:29 2015 +0100
Committer: Henryk Konsek <hekonsek@gmail.com>
Committed: Mon Jan 5 18:57:29 2015 +0100

----------------------------------------------------------------------
 .../camel/spring/boot/CamelAutoConfiguration.java      |  6 ------
 .../spring/boot/CamelConfigurationProperties.java      | 13 +++++++++++++
 .../boot/SpringConversionServiceConfiguration.java     |  9 +++++++++
 3 files changed, 22 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/dd202bc2/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
index 9b762d6..735944c 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java
@@ -19,7 +19,6 @@ package org.apache.camel.spring.boot;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.ProducerTemplate;
-import org.apache.camel.TypeConverter;
 import org.apache.camel.component.properties.PropertiesComponent;
 import org.apache.camel.component.properties.PropertiesParser;
 import org.apache.camel.spring.SpringCamelContext;
@@ -77,11 +76,6 @@ public class CamelAutoConfiguration {
     }
 
     @Bean
-    TypeConverter typeConverter(CamelContext camelContext) {
-        return camelContext.getTypeConverter();
-    }
-
-    @Bean
     PropertiesParser propertiesParser() {
         return new SpringPropertiesParser();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/dd202bc2/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
index 6992f19..0882c32 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java
@@ -36,6 +36,11 @@ public class CamelConfigurationProperties {
      */
     private int consumerTemplateCacheSize = 1000;
 
+    /**
+     *
+     */
+    private boolean typeConversion;
+
     public boolean isJmxEnabled() {
         return jmxEnabled;
     }
@@ -60,4 +65,12 @@ public class CamelConfigurationProperties {
         this.consumerTemplateCacheSize = consumerTemplateCacheSize;
     }
 
+    public boolean isTypeConversion() {
+        return typeConversion;
+    }
+
+    public void setTypeConversion(boolean typeConversion) {
+        this.typeConversion = typeConversion;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/dd202bc2/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringConversionServiceConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringConversionServiceConfiguration.java
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringConversionServiceConfiguration.java
index 7efcd2e..732dc89 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringConversionServiceConfiguration.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringConversionServiceConfiguration.java
@@ -18,7 +18,10 @@ package org.apache.camel.spring.boot;
 
 import static java.util.Arrays.asList;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.TypeConverter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -27,8 +30,14 @@ import org.springframework.core.convert.converter.Converter;
 import org.springframework.core.convert.support.DefaultConversionService;
 
 @Configuration
+@ConditionalOnProperty(value = "camel.springboot.typeConversion", matchIfMissing = true)
 public class SpringConversionServiceConfiguration {
 
+    @Bean
+    TypeConverter typeConverter(CamelContext camelContext) {
+        return camelContext.getTypeConverter();
+    }
+
     @ConditionalOnMissingBean
     @Bean
     ConversionService conversionService(ApplicationContext applicationContext) {


Mime
View raw message