Repository: camel
Updated Branches:
  refs/heads/master 8081351ff -> 7bde7d010


[Spring Boot] Polished Spring configuration.


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

Branch: refs/heads/master
Commit: 7bde7d0104a440fdfec64683036702ce157b78e0
Parents: 8081351
Author: Henryk Konsek <hekon...@gmail.com>
Authored: Wed Dec 31 16:02:59 2014 +0100
Committer: Henryk Konsek <hekon...@gmail.com>
Committed: Wed Dec 31 16:02:59 2014 +0100

----------------------------------------------------------------------
 .../spring/boot/CamelAutoConfiguration.java     | 23 +++++++++-----------
 1 file changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7bde7d01/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 9bf17db..9f1e9fa 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
@@ -104,18 +104,13 @@ import 
org.springframework.context.annotation.Configuration;
 @EnableConfigurationProperties(CamelConfigurationProperties.class)
 public class CamelAutoConfiguration {
 
-    @Autowired
-    private CamelConfigurationProperties configurationProperties;
-
-    @Autowired
-    private ApplicationContext applicationContext;
-
     /**
      * Spring-aware Camel context for the application. Auto-detects and loads 
all routes available in the Spring
      * context.
      */
     @Bean
-    CamelContext camelContext() throws Exception {
+    CamelContext camelContext(ApplicationContext applicationContext,
+                              CamelConfigurationProperties 
configurationProperties) {
         CamelContext camelContext = new SpringCamelContext(applicationContext);
 
         if (!configurationProperties.isJmxEnabled()) {
@@ -134,21 +129,23 @@ public class CamelAutoConfiguration {
      * Default producer template for the bootstrapped Camel context.
      */
     @Bean
-    ProducerTemplate producerTemplate() throws Exception {
-        return 
camelContext().createProducerTemplate(configurationProperties.getProducerTemplateCacheSize());
+    ProducerTemplate producerTemplate(CamelContext camelContext,
+                                      CamelConfigurationProperties 
configurationProperties) {
+        return 
camelContext.createProducerTemplate(configurationProperties.getProducerTemplateCacheSize());
     }
 
     /**
      * Default consumer template for the bootstrapped Camel context.
      */
     @Bean
-    ConsumerTemplate consumerTemplate() throws Exception {
-        return 
camelContext().createConsumerTemplate(configurationProperties.getConsumerTemplateCacheSize());
+    ConsumerTemplate consumerTemplate(CamelContext camelContext,
+                                      CamelConfigurationProperties 
configurationProperties) {
+        return 
camelContext.createConsumerTemplate(configurationProperties.getConsumerTemplateCacheSize());
     }
 
     @Bean
-    TypeConverter typeConverter() throws Exception {
-        return camelContext().getTypeConverter();
+    TypeConverter typeConverter(CamelContext camelContext) {
+        return camelContext.getTypeConverter();
     }
 
     @Bean

Reply via email to