http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java index d0fbc8e..9f46faf 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/simple/springboot/SimpleLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.language.simple.SimpleLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(SimpleLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SimpleLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, SimpleLanguageConfiguration.class}) -public class SimpleLanguageAutoConfiguration extends AllNestedConditions { +public class SimpleLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SimpleLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class SimpleLanguageAutoConfiguration extends AllNestedConditions { @Autowired private SimpleLanguageConfiguration languageConfiguration; - public SimpleLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.simple"); } } @Bean(name = "simple-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(SimpleLanguage.class) public SimpleLanguage configureSimpleLanguage() throws Exception { SimpleLanguage language = new SimpleLanguage();
http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java index 0a38257..bea928e 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/TokenizeLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.language.tokenizer.TokenizeLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(TokenizeLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + TokenizeLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, TokenizeLanguageConfiguration.class}) -public class TokenizeLanguageAutoConfiguration extends AllNestedConditions { +public class TokenizeLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(TokenizeLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class TokenizeLanguageAutoConfiguration extends AllNestedConditions { @Autowired private TokenizeLanguageConfiguration languageConfiguration; - public TokenizeLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.tokenize"); } } @Bean(name = "tokenize-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(TokenizeLanguage.class) public TokenizeLanguage configureTokenizeLanguage() throws Exception { TokenizeLanguage language = new TokenizeLanguage(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java index 6c2ed11..77b56b7 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/tokenizer/springboot/XMLTokenizeLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.language.tokenizer.XMLTokenizeLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(XMLTokenizeLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + XMLTokenizeLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, XMLTokenizeLanguageConfiguration.class}) -public class XMLTokenizeLanguageAutoConfiguration extends AllNestedConditions { +public class XMLTokenizeLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(XMLTokenizeLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class XMLTokenizeLanguageAutoConfiguration extends AllNestedConditions { @Autowired private XMLTokenizeLanguageConfiguration languageConfiguration; - public XMLTokenizeLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.xtokenize"); } } @Bean(name = "xtokenize-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(XMLTokenizeLanguage.class) public XMLTokenizeLanguage configureXMLTokenizeLanguage() throws Exception { XMLTokenizeLanguage language = new XMLTokenizeLanguage(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java index 435d70b..8a72c47 100644 --- a/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-core-starter/src/main/java/org/apache/camel/language/xpath/springboot/XPathLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.language.xpath.XPathLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(XPathLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + XPathLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, XPathLanguageConfiguration.class}) -public class XPathLanguageAutoConfiguration extends AllNestedConditions { +public class XPathLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(XPathLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class XPathLanguageAutoConfiguration extends AllNestedConditions { @Autowired private XPathLanguageConfiguration languageConfiguration; - public XPathLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.xpath"); } } @Bean(name = "xpath-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(XPathLanguage.class) public XPathLanguage configureXPathLanguage() throws Exception { XPathLanguage language = new XPathLanguage(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/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 fa3bfbb..c1457a2 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 @@ -25,6 +25,7 @@ import org.apache.camel.component.couchbase.CouchbaseComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(CouchbaseComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + CouchbaseComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, CouchbaseComponentConfiguration.class}) -public class CouchbaseComponentAutoConfiguration extends AllNestedConditions { +public class CouchbaseComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(CouchbaseComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class CouchbaseComponentAutoConfiguration extends AllNestedConditions { @Autowired private CouchbaseComponentConfiguration componentConfiguration; - public CouchbaseComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.couchbase"); } } @Lazy @Bean(name = "couchbase-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CouchbaseComponent.class) public CouchbaseComponent configureCouchbaseComponent() throws Exception { CouchbaseComponent component = new CouchbaseComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/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 493050d..c974dd5 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 @@ -25,6 +25,7 @@ import org.apache.camel.component.couchdb.CouchDbComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(CouchDbComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + CouchDbComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, CouchDbComponentConfiguration.class}) -public class CouchDbComponentAutoConfiguration extends AllNestedConditions { +public class CouchDbComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(CouchDbComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class CouchDbComponentAutoConfiguration extends AllNestedConditions { @Autowired private CouchDbComponentConfiguration componentConfiguration; - public CouchDbComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.couchdb"); } } @Lazy @Bean(name = "couchdb-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CouchDbComponent.class) public CouchDbComponent configureCouchDbComponent() throws Exception { CouchDbComponent component = new CouchDbComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java index 79a147f..524af67 100644 --- a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/component/crypto/springboot/DigitalSignatureComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.crypto.DigitalSignatureComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,13 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DigitalSignatureComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DigitalSignatureComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DigitalSignatureComponentConfiguration.class}) -public class DigitalSignatureComponentAutoConfiguration - extends - AllNestedConditions { +public class DigitalSignatureComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DigitalSignatureComponentAutoConfiguration.class); @@ -66,27 +64,14 @@ public class DigitalSignatureComponentAutoConfiguration @Autowired private DigitalSignatureComponentConfiguration componentConfiguration; - public DigitalSignatureComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.crypto"); } } @Lazy @Bean(name = "crypto-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DigitalSignatureComponent.class) public DigitalSignatureComponent configureDigitalSignatureComponent() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java index bac83bd..6990043 100644 --- a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatAutoConfiguration.java @@ -29,6 +29,7 @@ import org.apache.camel.spi.DataFormatCustomizer; import org.apache.camel.spi.DataFormatFactory; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.DataFormatConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -36,9 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -50,11 +49,12 @@ import org.springframework.context.annotation.Configuration; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(CryptoDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + CryptoDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, CryptoDataFormatConfiguration.class}) -public class CryptoDataFormatAutoConfiguration extends AllNestedConditions { +public class CryptoDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(CryptoDataFormatAutoConfiguration.class); @@ -67,31 +67,18 @@ public class CryptoDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private CryptoDataFormatConfiguration dataformatConfiguration; - public CryptoDataFormatAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.dataformat", "camel.dataformat.crypto"); } } @Bean(name = "crypto-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CryptoDataFormat.class) public DataFormatFactory configureCryptoDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { CryptoDataFormat dataformat = new CryptoDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java index 29c3ec4..fc2bdcb 100644 --- a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/PGPDataFormatAutoConfiguration.java @@ -29,6 +29,7 @@ import org.apache.camel.spi.DataFormatCustomizer; import org.apache.camel.spi.DataFormatFactory; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.DataFormatConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -36,9 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -50,11 +49,12 @@ import org.springframework.context.annotation.Configuration; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(PGPDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PGPDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, PGPDataFormatConfiguration.class}) -public class PGPDataFormatAutoConfiguration extends AllNestedConditions { +public class PGPDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PGPDataFormatAutoConfiguration.class); @@ -67,30 +67,17 @@ public class PGPDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private PGPDataFormatConfiguration dataformatConfiguration; - public PGPDataFormatAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.dataformat", "camel.dataformat.pgp"); } } @Bean(name = "pgp-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PGPDataFormat.class) public DataFormatFactory configurePGPDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { PGPDataFormat dataformat = new PGPDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java index 5a44d6f..7a3ae74 100644 --- a/platforms/spring-boot/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-csv-starter/src/main/java/org/apache/camel/dataformat/csv/springboot/CsvDataFormatAutoConfiguration.java @@ -29,6 +29,7 @@ import org.apache.camel.spi.DataFormatCustomizer; import org.apache.camel.spi.DataFormatFactory; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.DataFormatConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -36,9 +37,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -50,11 +49,12 @@ import org.springframework.context.annotation.Configuration; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(CsvDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + CsvDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, CsvDataFormatConfiguration.class}) -public class CsvDataFormatAutoConfiguration extends AllNestedConditions { +public class CsvDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(CsvDataFormatAutoConfiguration.class); @@ -67,30 +67,17 @@ public class CsvDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private CsvDataFormatConfiguration dataformatConfiguration; - public CsvDataFormatAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.dataformat", "camel.dataformat.csv"); } } @Bean(name = "csv-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CsvDataFormat.class) public DataFormatFactory configureCsvDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { CsvDataFormat dataformat = new CsvDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java index 7dd0606..2161483 100644 --- a/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/jaxrs/springboot/CxfRsComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.cxf.jaxrs.CxfRsComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(CxfRsComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + CxfRsComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, CxfRsComponentConfiguration.class}) -public class CxfRsComponentAutoConfiguration extends AllNestedConditions { +public class CxfRsComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(CxfRsComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class CxfRsComponentAutoConfiguration extends AllNestedConditions { @Autowired private CxfRsComponentConfiguration componentConfiguration; - public CxfRsComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.cxfrs"); } } @Lazy @Bean(name = "cxfrs-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CxfRsComponent.class) public CxfRsComponent configureCxfRsComponent() throws Exception { CxfRsComponent component = new CxfRsComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/springboot/CxfComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/springboot/CxfComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/springboot/CxfComponentAutoConfiguration.java index 31a9d7e..7f13d51 100644 --- a/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/springboot/CxfComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-cxf-starter/src/main/java/org/apache/camel/component/cxf/springboot/CxfComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.cxf.CxfComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(CxfComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + CxfComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, CxfComponentConfiguration.class}) -public class CxfComponentAutoConfiguration extends AllNestedConditions { +public class CxfComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(CxfComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class CxfComponentAutoConfiguration extends AllNestedConditions { @Autowired private CxfComponentConfiguration componentConfiguration; - public CxfComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.cxf"); } } @Lazy @Bean(name = "cxf-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(CxfComponent.class) public CxfComponent configureCxfComponent() throws Exception { CxfComponent component = new CxfComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-digitalocean-starter/src/main/java/org/apache/camel/component/digitalocean/springboot/DigitalOceanComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-digitalocean-starter/src/main/java/org/apache/camel/component/digitalocean/springboot/DigitalOceanComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-digitalocean-starter/src/main/java/org/apache/camel/component/digitalocean/springboot/DigitalOceanComponentAutoConfiguration.java index adda1cb..1cf5b24 100644 --- a/platforms/spring-boot/components-starter/camel-digitalocean-starter/src/main/java/org/apache/camel/component/digitalocean/springboot/DigitalOceanComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-digitalocean-starter/src/main/java/org/apache/camel/component/digitalocean/springboot/DigitalOceanComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.digitalocean.DigitalOceanComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DigitalOceanComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DigitalOceanComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DigitalOceanComponentConfiguration.class}) -public class DigitalOceanComponentAutoConfiguration extends AllNestedConditions { +public class DigitalOceanComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DigitalOceanComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DigitalOceanComponentAutoConfiguration extends AllNestedConditions @Autowired private DigitalOceanComponentConfiguration componentConfiguration; - public DigitalOceanComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.digitalocean"); } } @Lazy @Bean(name = "digitalocean-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DigitalOceanComponent.class) public DigitalOceanComponent configureDigitalOceanComponent() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java index eff0bdd..44c34d4 100644 --- a/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.disruptor.DisruptorComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DisruptorComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DisruptorComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DisruptorComponentConfiguration.class}) -public class DisruptorComponentAutoConfiguration extends AllNestedConditions { +public class DisruptorComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DisruptorComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DisruptorComponentAutoConfiguration extends AllNestedConditions { @Autowired private DisruptorComponentConfiguration componentConfiguration; - public DisruptorComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.disruptor"); } } @Lazy @Bean(name = "disruptor-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DisruptorComponent.class) public DisruptorComponent configureDisruptorComponent() throws Exception { DisruptorComponent component = new DisruptorComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java index 0cf740e..383105f 100644 --- a/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.disruptor.vm.DisruptorVmComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DisruptorVmComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DisruptorVmComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DisruptorVmComponentConfiguration.class}) -public class DisruptorVmComponentAutoConfiguration extends AllNestedConditions { +public class DisruptorVmComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DisruptorVmComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DisruptorVmComponentAutoConfiguration extends AllNestedConditions { @Autowired private DisruptorVmComponentConfiguration componentConfiguration; - public DisruptorVmComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.disruptor-vm"); } } @Lazy @Bean(name = "disruptor-vm-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DisruptorVmComponent.class) public DisruptorVmComponent configureDisruptorVmComponent() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/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 24f0dfd..32db459 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 @@ -25,6 +25,7 @@ import org.apache.camel.component.dns.DnsComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DnsComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DnsComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DnsComponentConfiguration.class}) -public class DnsComponentAutoConfiguration extends AllNestedConditions { +public class DnsComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DnsComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DnsComponentAutoConfiguration extends AllNestedConditions { @Autowired private DnsComponentConfiguration componentConfiguration; - public DnsComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.dns"); } } @Lazy @Bean(name = "dns-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DnsComponent.class) public DnsComponent configureDnsComponent() throws Exception { DnsComponent component = new DnsComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java index 02470cf..a098071 100644 --- a/platforms/spring-boot/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.docker.DockerComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DockerComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DockerComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DockerComponentConfiguration.class}) -public class DockerComponentAutoConfiguration extends AllNestedConditions { +public class DockerComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DockerComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DockerComponentAutoConfiguration extends AllNestedConditions { @Autowired private DockerComponentConfiguration componentConfiguration; - public DockerComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.docker"); } } @Lazy @Bean(name = "docker-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DockerComponent.class) public DockerComponent configureDockerComponent() throws Exception { DockerComponent component = new DockerComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/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 a411a70..1ca0ff4 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 @@ -25,6 +25,7 @@ import org.apache.camel.component.dozer.DozerComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DozerComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DozerComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DozerComponentConfiguration.class}) -public class DozerComponentAutoConfiguration extends AllNestedConditions { +public class DozerComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DozerComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DozerComponentAutoConfiguration extends AllNestedConditions { @Autowired private DozerComponentConfiguration componentConfiguration; - public DozerComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.dozer"); } } @Lazy @Bean(name = "dozer-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DozerComponent.class) public DozerComponent configureDozerComponent() throws Exception { DozerComponent component = new DozerComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/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 8c8cf56..93c6e31 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 @@ -25,6 +25,7 @@ import org.apache.camel.component.drill.DrillComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DrillComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DrillComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DrillComponentConfiguration.class}) -public class DrillComponentAutoConfiguration extends AllNestedConditions { +public class DrillComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DrillComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DrillComponentAutoConfiguration extends AllNestedConditions { @Autowired private DrillComponentConfiguration componentConfiguration; - public DrillComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.drill"); } } @Lazy @Bean(name = "drill-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DrillComponent.class) public DrillComponent configureDrillComponent() throws Exception { DrillComponent component = new DrillComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/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 fdf025f..55b25ce 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 @@ -25,6 +25,7 @@ import org.apache.camel.component.dropbox.DropboxComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(DropboxComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + DropboxComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, DropboxComponentConfiguration.class}) -public class DropboxComponentAutoConfiguration extends AllNestedConditions { +public class DropboxComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(DropboxComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class DropboxComponentAutoConfiguration extends AllNestedConditions { @Autowired private DropboxComponentConfiguration componentConfiguration; - public DropboxComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.dropbox"); } } @Lazy @Bean(name = "dropbox-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(DropboxComponent.class) public DropboxComponent configureDropboxComponent() throws Exception { DropboxComponent component = new DropboxComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/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 13646cd..6a84465 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 @@ -20,11 +20,13 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Generated; + import org.apache.camel.CamelContext; import org.apache.camel.component.ehcache.EhcacheComponent; import org.apache.camel.spi.ComponentCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.ComponentConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; @@ -32,9 +34,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -47,11 +46,12 @@ import org.springframework.context.annotation.Lazy; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(EhcacheComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + EhcacheComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, EhcacheComponentConfiguration.class}) -public class EhcacheComponentAutoConfiguration extends AllNestedConditions { +public class EhcacheComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(EhcacheComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class EhcacheComponentAutoConfiguration extends AllNestedConditions { @Autowired private EhcacheComponentConfiguration componentConfiguration; - public EhcacheComponentAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.ehcache"); } } @Lazy @Bean(name = "ehcache-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(EhcacheComponent.class) public EhcacheComponent configureEhcacheComponent() throws Exception { EhcacheComponent component = new EhcacheComponent();