http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-kestrel-starter/src/main/java/org/apache/camel/component/kestrel/springboot/KestrelComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-kestrel-starter/src/main/java/org/apache/camel/component/kestrel/springboot/KestrelComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-kestrel-starter/src/main/java/org/apache/camel/component/kestrel/springboot/KestrelComponentAutoConfiguration.java index a591369..84112b2 100644 --- a/platforms/spring-boot/components-starter/camel-kestrel-starter/src/main/java/org/apache/camel/component/kestrel/springboot/KestrelComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-kestrel-starter/src/main/java/org/apache/camel/component/kestrel/springboot/KestrelComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.kestrel.KestrelComponent; 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(KestrelComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + KestrelComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, KestrelComponentConfiguration.class}) -public class KestrelComponentAutoConfiguration extends AllNestedConditions { +public class KestrelComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(KestrelComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class KestrelComponentAutoConfiguration extends AllNestedConditions { @Autowired private KestrelComponentConfiguration componentConfiguration; - public KestrelComponentAutoConfiguration() { - 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.kestrel"); } } @Lazy @Bean(name = "kestrel-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(KestrelComponent.class) public KestrelComponent configureKestrelComponent() throws Exception { KestrelComponent component = new KestrelComponent();
http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java index b394541..703d8c7 100644 --- a/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-krati-starter/src/main/java/org/apache/camel/component/krati/springboot/KratiComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.krati.KratiComponent; 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(KratiComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + KratiComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, KratiComponentConfiguration.class}) -public class KratiComponentAutoConfiguration extends AllNestedConditions { +public class KratiComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(KratiComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class KratiComponentAutoConfiguration extends AllNestedConditions { @Autowired private KratiComponentConfiguration componentConfiguration; - public KratiComponentAutoConfiguration() { - 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.krati"); } } @Lazy @Bean(name = "krati-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(KratiComponent.class) public KratiComponent configureKratiComponent() throws Exception { KratiComponent component = new KratiComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java index 7e79bc3..bb4bc62 100644 --- a/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-kubernetes-starter/src/main/java/org/apache/camel/component/kubernetes/springboot/KubernetesComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.kubernetes.KubernetesComponent; 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(KubernetesComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + KubernetesComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, KubernetesComponentConfiguration.class}) -public class KubernetesComponentAutoConfiguration extends AllNestedConditions { +public class KubernetesComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(KubernetesComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class KubernetesComponentAutoConfiguration extends AllNestedConditions { @Autowired private KubernetesComponentConfiguration componentConfiguration; - public KubernetesComponentAutoConfiguration() { - 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.kubernetes"); } } @Lazy @Bean(name = "kubernetes-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(KubernetesComponent.class) public KubernetesComponent configureKubernetesComponent() throws Exception { KubernetesComponent component = new KubernetesComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java index f35efc3..bdd813d 100644 --- a/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-ldap-starter/src/main/java/org/apache/camel/component/ldap/springboot/LdapComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.ldap.LdapComponent; 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(LdapComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + LdapComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, LdapComponentConfiguration.class}) -public class LdapComponentAutoConfiguration extends AllNestedConditions { +public class LdapComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(LdapComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class LdapComponentAutoConfiguration extends AllNestedConditions { @Autowired private LdapComponentConfiguration componentConfiguration; - public LdapComponentAutoConfiguration() { - 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.ldap"); } } @Lazy @Bean(name = "ldap-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LdapComponent.class) public LdapComponent configureLdapComponent() throws Exception { LdapComponent component = new LdapComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentAutoConfiguration.java index 4b4e7fc..8cf3aa3 100644 --- a/platforms/spring-boot/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.linkedin.LinkedInComponent; 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(LinkedInComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + LinkedInComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, LinkedInComponentConfiguration.class}) -public class LinkedInComponentAutoConfiguration extends AllNestedConditions { +public class LinkedInComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(LinkedInComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class LinkedInComponentAutoConfiguration extends AllNestedConditions { @Autowired private LinkedInComponentConfiguration componentConfiguration; - public LinkedInComponentAutoConfiguration() { - 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.linkedin"); } } @Lazy @Bean(name = "linkedin-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LinkedInComponent.class) public LinkedInComponent configureLinkedInComponent() throws Exception { LinkedInComponent component = new LinkedInComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-lucene-starter/src/main/java/org/apache/camel/component/lucene/springboot/LuceneComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-lucene-starter/src/main/java/org/apache/camel/component/lucene/springboot/LuceneComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-lucene-starter/src/main/java/org/apache/camel/component/lucene/springboot/LuceneComponentAutoConfiguration.java index 9e8160d..db461b6 100644 --- a/platforms/spring-boot/components-starter/camel-lucene-starter/src/main/java/org/apache/camel/component/lucene/springboot/LuceneComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-lucene-starter/src/main/java/org/apache/camel/component/lucene/springboot/LuceneComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.lucene.LuceneComponent; 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(LuceneComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + LuceneComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, LuceneComponentConfiguration.class}) -public class LuceneComponentAutoConfiguration extends AllNestedConditions { +public class LuceneComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(LuceneComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class LuceneComponentAutoConfiguration extends AllNestedConditions { @Autowired private LuceneComponentConfiguration componentConfiguration; - public LuceneComponentAutoConfiguration() { - 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.lucene"); } } @Lazy @Bean(name = "lucene-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LuceneComponent.class) public LuceneComponent configureLuceneComponent() throws Exception { LuceneComponent component = new LuceneComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-lumberjack-starter/src/main/java/org/apache/camel/component/lumberjack/springboot/LumberjackComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-lumberjack-starter/src/main/java/org/apache/camel/component/lumberjack/springboot/LumberjackComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-lumberjack-starter/src/main/java/org/apache/camel/component/lumberjack/springboot/LumberjackComponentAutoConfiguration.java index 5e020cb..0bb6a3e 100644 --- a/platforms/spring-boot/components-starter/camel-lumberjack-starter/src/main/java/org/apache/camel/component/lumberjack/springboot/LumberjackComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-lumberjack-starter/src/main/java/org/apache/camel/component/lumberjack/springboot/LumberjackComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.lumberjack.LumberjackComponent; 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(LumberjackComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + LumberjackComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, LumberjackComponentConfiguration.class}) -public class LumberjackComponentAutoConfiguration extends AllNestedConditions { +public class LumberjackComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(LumberjackComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class LumberjackComponentAutoConfiguration extends AllNestedConditions { @Autowired private LumberjackComponentConfiguration componentConfiguration; - public LumberjackComponentAutoConfiguration() { - 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.lumberjack"); } } @Lazy @Bean(name = "lumberjack-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LumberjackComponent.class) public LumberjackComponent configureLumberjackComponent() throws Exception { LumberjackComponent component = new LumberjackComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java index 0e7b5a9..cea9e9e 100644 --- a/platforms/spring-boot/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-lzf-starter/src/main/java/org/apache/camel/dataformat/lzf/springboot/LZFDataFormatAutoConfiguration.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(LZFDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + LZFDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, LZFDataFormatConfiguration.class}) -public class LZFDataFormatAutoConfiguration extends AllNestedConditions { +public class LZFDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(LZFDataFormatAutoConfiguration.class); @@ -67,30 +67,17 @@ public class LZFDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private LZFDataFormatConfiguration dataformatConfiguration; - public LZFDataFormatAutoConfiguration() { - 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.lzf"); } } @Bean(name = "lzf-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(LZFDataFormat.class) public DataFormatFactory configureLZFDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { LZFDataFormat dataformat = new LZFDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/component/mail/springboot/MailComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/component/mail/springboot/MailComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/component/mail/springboot/MailComponentAutoConfiguration.java index fb413ff..6dc403d 100644 --- a/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/component/mail/springboot/MailComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/component/mail/springboot/MailComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mail.MailComponent; 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(MailComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MailComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MailComponentConfiguration.class}) -public class MailComponentAutoConfiguration extends AllNestedConditions { +public class MailComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MailComponentAutoConfiguration.class); @@ -64,20 +64,8 @@ public class MailComponentAutoConfiguration extends AllNestedConditions { @Autowired private MailComponentConfiguration componentConfiguration; - public MailComponentAutoConfiguration() { - 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.mail"); } } @@ -85,7 +73,6 @@ public class MailComponentAutoConfiguration extends AllNestedConditions { @Lazy @Bean(name = {"imap-component", "imaps-component", "pop3-component", "pop3s-component", "smtp-component", "smtps-component"}) - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MailComponent.class) public MailComponent configureMailComponent() throws Exception { MailComponent component = new MailComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java index 69b5bcd..495c0fb 100644 --- a/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mail-starter/src/main/java/org/apache/camel/dataformat/mime/multipart/springboot/MimeMultipartDataFormatAutoConfiguration.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,13 +49,12 @@ import org.springframework.context.annotation.Configuration; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(MimeMultipartDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MimeMultipartDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, MimeMultipartDataFormatConfiguration.class}) -public class MimeMultipartDataFormatAutoConfiguration - extends - AllNestedConditions { +public class MimeMultipartDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MimeMultipartDataFormatAutoConfiguration.class); @@ -69,31 +67,18 @@ public class MimeMultipartDataFormatAutoConfiguration @Autowired private MimeMultipartDataFormatConfiguration dataformatConfiguration; - public MimeMultipartDataFormatAutoConfiguration() { - 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.mime-multipart"); } } @Bean(name = "mime-multipart-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MimeMultipartDataFormat.class) public DataFormatFactory configureMimeMultipartDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { MimeMultipartDataFormat dataformat = new MimeMultipartDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-metrics-starter/src/main/java/org/apache/camel/component/metrics/springboot/MetricsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-metrics-starter/src/main/java/org/apache/camel/component/metrics/springboot/MetricsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-metrics-starter/src/main/java/org/apache/camel/component/metrics/springboot/MetricsComponentAutoConfiguration.java index a684e9f..38b6c78 100644 --- a/platforms/spring-boot/components-starter/camel-metrics-starter/src/main/java/org/apache/camel/component/metrics/springboot/MetricsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-metrics-starter/src/main/java/org/apache/camel/component/metrics/springboot/MetricsComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.metrics.MetricsComponent; 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(MetricsComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MetricsComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MetricsComponentConfiguration.class}) -public class MetricsComponentAutoConfiguration extends AllNestedConditions { +public class MetricsComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MetricsComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MetricsComponentAutoConfiguration extends AllNestedConditions { @Autowired private MetricsComponentConfiguration componentConfiguration; - public MetricsComponentAutoConfiguration() { - 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.metrics"); } } @Lazy @Bean(name = "metrics-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MetricsComponent.class) public MetricsComponent configureMetricsComponent() throws Exception { MetricsComponent component = new MetricsComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java index 78f6adb..e2fe9a9 100644 --- a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/client/springboot/MiloClientComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.milo.client.MiloClientComponent; 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(MiloClientComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MiloClientComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MiloClientComponentConfiguration.class}) -public class MiloClientComponentAutoConfiguration extends AllNestedConditions { +public class MiloClientComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MiloClientComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MiloClientComponentAutoConfiguration extends AllNestedConditions { @Autowired private MiloClientComponentConfiguration componentConfiguration; - public MiloClientComponentAutoConfiguration() { - 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.milo-client"); } } @Lazy @Bean(name = "milo-client-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MiloClientComponent.class) public MiloClientComponent configureMiloClientComponent() throws Exception { MiloClientComponent component = new MiloClientComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java index 0446f61..3a07386 100644 --- a/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-milo-starter/src/main/java/org/apache/camel/component/milo/server/springboot/MiloServerComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.milo.server.MiloServerComponent; 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(MiloServerComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MiloServerComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MiloServerComponentConfiguration.class}) -public class MiloServerComponentAutoConfiguration extends AllNestedConditions { +public class MiloServerComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MiloServerComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MiloServerComponentAutoConfiguration extends AllNestedConditions { @Autowired private MiloServerComponentConfiguration componentConfiguration; - public MiloServerComponentAutoConfiguration() { - 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.milo-server"); } } @Lazy @Bean(name = "milo-server-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MiloServerComponent.class) public MiloServerComponent configureMiloServerComponent() throws Exception { MiloServerComponent component = new MiloServerComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mina2-starter/src/main/java/org/apache/camel/component/mina2/springboot/Mina2ComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mina2-starter/src/main/java/org/apache/camel/component/mina2/springboot/Mina2ComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mina2-starter/src/main/java/org/apache/camel/component/mina2/springboot/Mina2ComponentAutoConfiguration.java index 948f392..6240f5c 100644 --- a/platforms/spring-boot/components-starter/camel-mina2-starter/src/main/java/org/apache/camel/component/mina2/springboot/Mina2ComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mina2-starter/src/main/java/org/apache/camel/component/mina2/springboot/Mina2ComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mina2.Mina2Component; 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(Mina2ComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + Mina2ComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, Mina2ComponentConfiguration.class}) -public class Mina2ComponentAutoConfiguration extends AllNestedConditions { +public class Mina2ComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(Mina2ComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class Mina2ComponentAutoConfiguration extends AllNestedConditions { @Autowired private Mina2ComponentConfiguration componentConfiguration; - public Mina2ComponentAutoConfiguration() { - 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.mina2"); } } @Lazy @Bean(name = "mina2-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(Mina2Component.class) public Mina2Component configureMina2Component() throws Exception { Mina2Component component = new Mina2Component(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java index c460170..cb726c1 100644 --- a/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mllp-starter/src/main/java/org/apache/camel/component/mllp/springboot/MllpComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mllp.MllpComponent; 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(MllpComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MllpComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MllpComponentConfiguration.class}) -public class MllpComponentAutoConfiguration extends AllNestedConditions { +public class MllpComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MllpComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MllpComponentAutoConfiguration extends AllNestedConditions { @Autowired private MllpComponentConfiguration componentConfiguration; - public MllpComponentAutoConfiguration() { - 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.mllp"); } } @Lazy @Bean(name = "mllp-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MllpComponent.class) public MllpComponent configureMllpComponent() throws Exception { MllpComponent component = new MllpComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java index e7d0b31..e7e2bc0 100644 --- a/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mongodb-gridfs-starter/src/main/java/org/apache/camel/component/mongodb/gridfs/springboot/GridFsComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mongodb.gridfs.GridFsComponent; 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(GridFsComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + GridFsComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, GridFsComponentConfiguration.class}) -public class GridFsComponentAutoConfiguration extends AllNestedConditions { +public class GridFsComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(GridFsComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class GridFsComponentAutoConfiguration extends AllNestedConditions { @Autowired private GridFsComponentConfiguration componentConfiguration; - public GridFsComponentAutoConfiguration() { - 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.mongodb-gridfs"); } } @Lazy @Bean(name = "mongodb-gridfs-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(GridFsComponent.class) public GridFsComponent configureGridFsComponent() throws Exception { GridFsComponent component = new GridFsComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java index 3b8ab68..a0690ea 100644 --- a/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mongodb-starter/src/main/java/org/apache/camel/component/mongodb/springboot/MongoDbComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mongodb.MongoDbComponent; 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(MongoDbComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MongoDbComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MongoDbComponentConfiguration.class}) -public class MongoDbComponentAutoConfiguration extends AllNestedConditions { +public class MongoDbComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MongoDbComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MongoDbComponentAutoConfiguration extends AllNestedConditions { @Autowired private MongoDbComponentConfiguration componentConfiguration; - public MongoDbComponentAutoConfiguration() { - 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.mongodb"); } } @Lazy @Bean(name = "mongodb-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MongoDbComponent.class) public MongoDbComponent configureMongoDbComponent() throws Exception { MongoDbComponent component = new MongoDbComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java index d7e8fea..9258da9 100644 --- a/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mongodb3-starter/src/main/java/org/apache/camel/component/mongodb3/springboot/MongoDbComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mongodb3.MongoDbComponent; 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(MongoDbComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MongoDbComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MongoDbComponentConfiguration.class}) -public class MongoDbComponentAutoConfiguration extends AllNestedConditions { +public class MongoDbComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MongoDbComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MongoDbComponentAutoConfiguration extends AllNestedConditions { @Autowired private MongoDbComponentConfiguration componentConfiguration; - public MongoDbComponentAutoConfiguration() { - 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.mongodb3"); } } @Lazy @Bean(name = "mongodb3-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MongoDbComponent.class) public MongoDbComponent configureMongoDbComponent() throws Exception { MongoDbComponent component = new MongoDbComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java index 4121a9f..dc86cc2 100644 --- a/platforms/spring-boot/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mqtt.MQTTComponent; 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(MQTTComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MQTTComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MQTTComponentConfiguration.class}) -public class MQTTComponentAutoConfiguration extends AllNestedConditions { +public class MQTTComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MQTTComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MQTTComponentAutoConfiguration extends AllNestedConditions { @Autowired private MQTTComponentConfiguration componentConfiguration; - public MQTTComponentAutoConfiguration() { - 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.mqtt"); } } @Lazy @Bean(name = "mqtt-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MQTTComponent.class) public MQTTComponent configureMQTTComponent() throws Exception { MQTTComponent component = new MQTTComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java index af26797..59e7ee6 100644 --- a/platforms/spring-boot/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.validator.msv.MsvComponent; 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(MsvComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MsvComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MsvComponentConfiguration.class}) -public class MsvComponentAutoConfiguration extends AllNestedConditions { +public class MsvComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MsvComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MsvComponentAutoConfiguration extends AllNestedConditions { @Autowired private MsvComponentConfiguration componentConfiguration; - public MsvComponentAutoConfiguration() { - 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.msv"); } } @Lazy @Bean(name = "msv-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MsvComponent.class) public MsvComponent configureMsvComponent() throws Exception { MsvComponent component = new MsvComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mustache-starter/src/main/java/org/apache/camel/component/mustache/springboot/MustacheComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mustache-starter/src/main/java/org/apache/camel/component/mustache/springboot/MustacheComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mustache-starter/src/main/java/org/apache/camel/component/mustache/springboot/MustacheComponentAutoConfiguration.java index df79b0b..24debe1 100644 --- a/platforms/spring-boot/components-starter/camel-mustache-starter/src/main/java/org/apache/camel/component/mustache/springboot/MustacheComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mustache-starter/src/main/java/org/apache/camel/component/mustache/springboot/MustacheComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mustache.MustacheComponent; 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(MustacheComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MustacheComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MustacheComponentConfiguration.class}) -public class MustacheComponentAutoConfiguration extends AllNestedConditions { +public class MustacheComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MustacheComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MustacheComponentAutoConfiguration extends AllNestedConditions { @Autowired private MustacheComponentConfiguration componentConfiguration; - public MustacheComponentAutoConfiguration() { - 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.mustache"); } } @Lazy @Bean(name = "mustache-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MustacheComponent.class) public MustacheComponent configureMustacheComponent() throws Exception { MustacheComponent component = new MustacheComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java index 08c1bd2..37435a3 100644 --- a/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-mvel-starter/src/main/java/org/apache/camel/component/mvel/springboot/MvelComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.mvel.MvelComponent; 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(MvelComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + MvelComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, MvelComponentConfiguration.class}) -public class MvelComponentAutoConfiguration extends AllNestedConditions { +public class MvelComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(MvelComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class MvelComponentAutoConfiguration extends AllNestedConditions { @Autowired private MvelComponentConfiguration componentConfiguration; - public MvelComponentAutoConfiguration() { - 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.mvel"); } } @Lazy @Bean(name = "mvel-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(MvelComponent.class) public MvelComponent configureMvelComponent() throws Exception { MvelComponent component = new MvelComponent();