http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-paho-starter/src/main/java/org/apache/camel/component/paho/springboot/PahoComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-paho-starter/src/main/java/org/apache/camel/component/paho/springboot/PahoComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-paho-starter/src/main/java/org/apache/camel/component/paho/springboot/PahoComponentAutoConfiguration.java index 44f2995..7c8c9c0 100644 --- a/platforms/spring-boot/components-starter/camel-paho-starter/src/main/java/org/apache/camel/component/paho/springboot/PahoComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-paho-starter/src/main/java/org/apache/camel/component/paho/springboot/PahoComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.paho.PahoComponent; 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(PahoComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PahoComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, PahoComponentConfiguration.class}) -public class PahoComponentAutoConfiguration extends AllNestedConditions { +public class PahoComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PahoComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class PahoComponentAutoConfiguration extends AllNestedConditions { @Autowired private PahoComponentConfiguration componentConfiguration; - public PahoComponentAutoConfiguration() { - 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.paho"); } } @Lazy @Bean(name = "paho-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PahoComponent.class) public PahoComponent configurePahoComponent() throws Exception { PahoComponent component = new PahoComponent();
http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java index d0b50b1..5744d96 100644 --- a/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-pdf-starter/src/main/java/org/apache/camel/component/pdf/springboot/PdfComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.pdf.PdfComponent; 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(PdfComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PdfComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, PdfComponentConfiguration.class}) -public class PdfComponentAutoConfiguration extends AllNestedConditions { +public class PdfComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PdfComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class PdfComponentAutoConfiguration extends AllNestedConditions { @Autowired private PdfComponentConfiguration componentConfiguration; - public PdfComponentAutoConfiguration() { - 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.pdf"); } } @Lazy @Bean(name = "pdf-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PdfComponent.class) public PdfComponent configurePdfComponent() throws Exception { PdfComponent component = new PdfComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java index a228390..9f81379 100644 --- a/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-pgevent-starter/src/main/java/org/apache/camel/component/pgevent/springboot/PgEventComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.pgevent.PgEventComponent; 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(PgEventComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PgEventComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, PgEventComponentConfiguration.class}) -public class PgEventComponentAutoConfiguration extends AllNestedConditions { +public class PgEventComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PgEventComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class PgEventComponentAutoConfiguration extends AllNestedConditions { @Autowired private PgEventComponentConfiguration componentConfiguration; - public PgEventComponentAutoConfiguration() { - 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.pgevent"); } } @Lazy @Bean(name = "pgevent-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PgEventComponent.class) public PgEventComponent configurePgEventComponent() throws Exception { PgEventComponent component = new PgEventComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-printer-starter/src/main/java/org/apache/camel/component/printer/springboot/PrinterComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-printer-starter/src/main/java/org/apache/camel/component/printer/springboot/PrinterComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-printer-starter/src/main/java/org/apache/camel/component/printer/springboot/PrinterComponentAutoConfiguration.java index 5059829..b2515e7 100644 --- a/platforms/spring-boot/components-starter/camel-printer-starter/src/main/java/org/apache/camel/component/printer/springboot/PrinterComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-printer-starter/src/main/java/org/apache/camel/component/printer/springboot/PrinterComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.printer.PrinterComponent; 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(PrinterComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PrinterComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, PrinterComponentConfiguration.class}) -public class PrinterComponentAutoConfiguration extends AllNestedConditions { +public class PrinterComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PrinterComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class PrinterComponentAutoConfiguration extends AllNestedConditions { @Autowired private PrinterComponentConfiguration componentConfiguration; - public PrinterComponentAutoConfiguration() { - 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.lpr"); } } @Lazy @Bean(name = "lpr-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PrinterComponent.class) public PrinterComponent configurePrinterComponent() throws Exception { PrinterComponent component = new PrinterComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java index b995a59..556c2da 100644 --- a/platforms/spring-boot/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-protobuf-starter/src/main/java/org/apache/camel/dataformat/protobuf/springboot/ProtobufDataFormatAutoConfiguration.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(ProtobufDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + ProtobufDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, ProtobufDataFormatConfiguration.class}) -public class ProtobufDataFormatAutoConfiguration extends AllNestedConditions { +public class ProtobufDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(ProtobufDataFormatAutoConfiguration.class); @@ -67,31 +67,18 @@ public class ProtobufDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private ProtobufDataFormatConfiguration dataformatConfiguration; - public ProtobufDataFormatAutoConfiguration() { - 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.protobuf"); } } @Bean(name = "protobuf-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ProtobufDataFormat.class) public DataFormatFactory configureProtobufDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { ProtobufDataFormat dataformat = new ProtobufDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-pubnub-starter/src/main/java/org/apache/camel/component/pubnub/springboot/PubNubComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-pubnub-starter/src/main/java/org/apache/camel/component/pubnub/springboot/PubNubComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-pubnub-starter/src/main/java/org/apache/camel/component/pubnub/springboot/PubNubComponentAutoConfiguration.java index e47a35a..170fb4c 100644 --- a/platforms/spring-boot/components-starter/camel-pubnub-starter/src/main/java/org/apache/camel/component/pubnub/springboot/PubNubComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-pubnub-starter/src/main/java/org/apache/camel/component/pubnub/springboot/PubNubComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.pubnub.PubNubComponent; 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(PubNubComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PubNubComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, PubNubComponentConfiguration.class}) -public class PubNubComponentAutoConfiguration extends AllNestedConditions { +public class PubNubComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PubNubComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class PubNubComponentAutoConfiguration extends AllNestedConditions { @Autowired private PubNubComponentConfiguration componentConfiguration; - public PubNubComponentAutoConfiguration() { - 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.pubnub"); } } @Lazy @Bean(name = "pubnub-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(PubNubComponent.class) public PubNubComponent configurePubNubComponent() throws Exception { PubNubComponent component = new PubNubComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-quartz2-starter/src/main/java/org/apache/camel/component/quartz2/springboot/QuartzComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-quartz2-starter/src/main/java/org/apache/camel/component/quartz2/springboot/QuartzComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-quartz2-starter/src/main/java/org/apache/camel/component/quartz2/springboot/QuartzComponentAutoConfiguration.java index 7a65a7b..002c32f 100644 --- a/platforms/spring-boot/components-starter/camel-quartz2-starter/src/main/java/org/apache/camel/component/quartz2/springboot/QuartzComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-quartz2-starter/src/main/java/org/apache/camel/component/quartz2/springboot/QuartzComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.quartz2.QuartzComponent; 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(QuartzComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + QuartzComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, QuartzComponentConfiguration.class}) -public class QuartzComponentAutoConfiguration extends AllNestedConditions { +public class QuartzComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(QuartzComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class QuartzComponentAutoConfiguration extends AllNestedConditions { @Autowired private QuartzComponentConfiguration componentConfiguration; - public QuartzComponentAutoConfiguration() { - 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.quartz2"); } } @Lazy @Bean(name = "quartz2-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(QuartzComponent.class) public QuartzComponent configureQuartzComponent() throws Exception { QuartzComponent component = new QuartzComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentAutoConfiguration.java index e8c7e17..7ac32d2 100644 --- a/platforms/spring-boot/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.quickfixj.QuickfixjComponent; 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(QuickfixjComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + QuickfixjComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, QuickfixjComponentConfiguration.class}) -public class QuickfixjComponentAutoConfiguration extends AllNestedConditions { +public class QuickfixjComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(QuickfixjComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class QuickfixjComponentAutoConfiguration extends AllNestedConditions { @Autowired private QuickfixjComponentConfiguration componentConfiguration; - public QuickfixjComponentAutoConfiguration() { - 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.quickfix"); } } @Lazy @Bean(name = "quickfix-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(QuickfixjComponent.class) public QuickfixjComponent configureQuickfixjComponent() throws Exception { QuickfixjComponent component = new QuickfixjComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-rabbitmq-starter/src/main/java/org/apache/camel/component/rabbitmq/springboot/RabbitMQComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-rabbitmq-starter/src/main/java/org/apache/camel/component/rabbitmq/springboot/RabbitMQComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-rabbitmq-starter/src/main/java/org/apache/camel/component/rabbitmq/springboot/RabbitMQComponentAutoConfiguration.java index 3d4c632..fbce0c6 100644 --- a/platforms/spring-boot/components-starter/camel-rabbitmq-starter/src/main/java/org/apache/camel/component/rabbitmq/springboot/RabbitMQComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-rabbitmq-starter/src/main/java/org/apache/camel/component/rabbitmq/springboot/RabbitMQComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.rabbitmq.RabbitMQComponent; 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(RabbitMQComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RabbitMQComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, RabbitMQComponentConfiguration.class}) -public class RabbitMQComponentAutoConfiguration extends AllNestedConditions { +public class RabbitMQComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RabbitMQComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class RabbitMQComponentAutoConfiguration extends AllNestedConditions { @Autowired private RabbitMQComponentConfiguration componentConfiguration; - public RabbitMQComponentAutoConfiguration() { - 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.rabbitmq"); } } @Lazy @Bean(name = "rabbitmq-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RabbitMQComponent.class) public RabbitMQComponent configureRabbitMQComponent() throws Exception { RabbitMQComponent component = new RabbitMQComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/main/java/org/apache/camel/component/reactive/streams/springboot/ReactiveStreamsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/main/java/org/apache/camel/component/reactive/streams/springboot/ReactiveStreamsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/main/java/org/apache/camel/component/reactive/streams/springboot/ReactiveStreamsComponentAutoConfiguration.java index c2ef551..d2bd579 100644 --- a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/main/java/org/apache/camel/component/reactive/streams/springboot/ReactiveStreamsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/main/java/org/apache/camel/component/reactive/streams/springboot/ReactiveStreamsComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.reactive.streams.ReactiveStreamsComponent; 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(ReactiveStreamsComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + ReactiveStreamsComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, ReactiveStreamsComponentConfiguration.class}) -public class ReactiveStreamsComponentAutoConfiguration - extends - AllNestedConditions { +public class ReactiveStreamsComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(ReactiveStreamsComponentAutoConfiguration.class); @@ -66,27 +64,14 @@ public class ReactiveStreamsComponentAutoConfiguration @Autowired private ReactiveStreamsComponentConfiguration componentConfiguration; - public ReactiveStreamsComponentAutoConfiguration() { - 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.reactive-streams"); } } @Lazy @Bean(name = "reactive-streams-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ReactiveStreamsComponent.class) public ReactiveStreamsComponent configureReactiveStreamsComponent() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsAutoConfigurationTest.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsAutoConfigurationTest.java b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsAutoConfigurationTest.java index 65c75c3..9af8ae1 100644 --- a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsAutoConfigurationTest.java +++ b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsAutoConfigurationTest.java @@ -26,9 +26,6 @@ import org.apache.camel.component.reactive.streams.ReactiveStreamsConstants; import org.apache.camel.component.reactive.streams.api.CamelReactiveStreams; import org.apache.camel.component.reactive.streams.api.CamelReactiveStreamsService; import org.apache.camel.component.reactive.streams.engine.DefaultCamelReactiveStreamsService; -import org.apache.camel.component.reactive.streams.springboot.ReactiveStreamsComponentAutoConfiguration; -import org.apache.camel.component.reactive.streams.springboot.ReactiveStreamsServiceAutoConfiguration; -import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.junit.Test; import org.junit.runner.RunWith; import org.reactivestreams.Publisher; @@ -37,6 +34,7 @@ import org.reactivestreams.Subscription; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @@ -46,13 +44,11 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @RunWith(SpringRunner.class) -@SpringBootApplication @DirtiesContext +@SpringBootApplication @SpringBootTest( classes = { - ReactiveStreamsServiceAutoConfiguration.class, - ReactiveStreamsComponentAutoConfiguration.class, - CamelAutoConfiguration.class + ReactiveStreamsAutoConfigurationTest.TestConfiguration.class }, properties = { "camel.component.reactive-streams.internal-engine-configuration.thread-pool-name=rs-test" @@ -120,5 +116,9 @@ public class ReactiveStreamsAutoConfigurationTest { .to("reactive-streams:stream"); } } + + @Configuration + public static class TestConfiguration { + } } http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsDefaultEngineTest.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsDefaultEngineTest.java b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsDefaultEngineTest.java index c306ca0..14aa145 100644 --- a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsDefaultEngineTest.java +++ b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsDefaultEngineTest.java @@ -21,15 +21,13 @@ import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.reactive.streams.api.CamelReactiveStreams; import org.apache.camel.component.reactive.streams.api.CamelReactiveStreamsService; import org.apache.camel.component.reactive.streams.engine.DefaultCamelReactiveStreamsService; -import org.apache.camel.component.reactive.streams.springboot.ReactiveStreamsComponentAutoConfiguration; -import org.apache.camel.component.reactive.streams.springboot.ReactiveStreamsServiceAutoConfiguration; -import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Configuration; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @@ -37,14 +35,12 @@ import org.springframework.test.context.junit4.SpringRunner; * Checking that the deadlock does not occur when the {@code CamelReactiveStreamsService} is not injected anywhere. */ @RunWith(SpringRunner.class) -@SpringBootApplication @DirtiesContext +@SpringBootApplication @SpringBootTest( - classes = { - ReactiveStreamsServiceAutoConfiguration.class, - ReactiveStreamsComponentAutoConfiguration.class, - CamelAutoConfiguration.class - } + classes = { + ReactiveStreamsDefaultEngineTest.class + } ) public class ReactiveStreamsDefaultEngineTest { @Autowired @@ -66,6 +62,8 @@ public class ReactiveStreamsDefaultEngineTest { Assert.assertTrue(service instanceof DefaultCamelReactiveStreamsService); } - + @Configuration + public static class TestConfiguration { + } } http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsNamedEngineTest.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsNamedEngineTest.java b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsNamedEngineTest.java index 03c2ec8..8320c32 100644 --- a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsNamedEngineTest.java +++ b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsNamedEngineTest.java @@ -29,6 +29,7 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @@ -38,9 +39,7 @@ import org.springframework.test.context.junit4.SpringRunner; @DirtiesContext @SpringBootTest( classes = { - ReactiveStreamsServiceAutoConfiguration.class, - ReactiveStreamsComponentAutoConfiguration.class, - CamelAutoConfiguration.class + ReactiveStreamsNamedEngineTest.TestConfiguration.class }, properties = { "camel.component.reactive-streams.service-type=my-engine" @@ -61,11 +60,13 @@ public class ReactiveStreamsNamedEngineTest { @Component("my-engine") static class MyEngine extends ReactiveStreamsServiceTestSupport { - public MyEngine() { super("my-engine"); } + } + @Configuration + public static class TestConfiguration { } } http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsRegistryEngineTest.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsRegistryEngineTest.java b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsRegistryEngineTest.java index 5e1ec0c..8630f4f 100644 --- a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsRegistryEngineTest.java +++ b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/java/org/apache/camel/component/reactive/streams/springboot/test/ReactiveStreamsRegistryEngineTest.java @@ -29,6 +29,7 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Configuration; import org.springframework.stereotype.Component; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @@ -38,9 +39,7 @@ import org.springframework.test.context.junit4.SpringRunner; @DirtiesContext @SpringBootTest( classes = { - ReactiveStreamsServiceAutoConfiguration.class, - ReactiveStreamsComponentAutoConfiguration.class, - CamelAutoConfiguration.class + ReactiveStreamsRegistryEngineTest.TestConfiguration.class } ) public class ReactiveStreamsRegistryEngineTest { @@ -58,11 +57,13 @@ public class ReactiveStreamsRegistryEngineTest { @Component("my-engine") static class MyEngine extends ReactiveStreamsServiceTestSupport { - public MyEngine() { super("my-engine"); } + } + @Configuration + public static class TestConfiguration { } } http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/resources/application.properties ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/resources/application.properties b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/resources/application.properties new file mode 100644 index 0000000..d568c34 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-reactive-streams-starter/src/test/resources/application.properties @@ -0,0 +1 @@ +spring.main.banner-mode = off \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentAutoConfiguration.java index 1dc975c..cd77f0c 100644 --- a/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-rest-swagger-starter/src/main/java/org/apache/camel/component/rest/swagger/springboot/RestSwaggerComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.rest.swagger.RestSwaggerComponent; 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(RestSwaggerComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RestSwaggerComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, RestSwaggerComponentConfiguration.class}) -public class RestSwaggerComponentAutoConfiguration extends AllNestedConditions { +public class RestSwaggerComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RestSwaggerComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class RestSwaggerComponentAutoConfiguration extends AllNestedConditions { @Autowired private RestSwaggerComponentConfiguration componentConfiguration; - public RestSwaggerComponentAutoConfiguration() { - 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.rest-swagger"); } } @Lazy @Bean(name = "rest-swagger-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RestSwaggerComponent.class) public RestSwaggerComponent configureRestSwaggerComponent() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java index 6a16e7f..6f6df84 100644 --- a/platforms/spring-boot/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.restlet.RestletComponent; 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(RestletComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RestletComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, RestletComponentConfiguration.class}) -public class RestletComponentAutoConfiguration extends AllNestedConditions { +public class RestletComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RestletComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class RestletComponentAutoConfiguration extends AllNestedConditions { @Autowired private RestletComponentConfiguration componentConfiguration; - public RestletComponentAutoConfiguration() { - 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.restlet"); } } @Lazy @Bean(name = "restlet-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RestletComponent.class) public RestletComponent configureRestletComponent() throws Exception { RestletComponent component = new RestletComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-rmi-starter/src/main/java/org/apache/camel/component/rmi/springboot/RmiComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-rmi-starter/src/main/java/org/apache/camel/component/rmi/springboot/RmiComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-rmi-starter/src/main/java/org/apache/camel/component/rmi/springboot/RmiComponentAutoConfiguration.java index 12ef5ba..2e2d8f0 100644 --- a/platforms/spring-boot/components-starter/camel-rmi-starter/src/main/java/org/apache/camel/component/rmi/springboot/RmiComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-rmi-starter/src/main/java/org/apache/camel/component/rmi/springboot/RmiComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.rmi.RmiComponent; 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(RmiComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RmiComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, RmiComponentConfiguration.class}) -public class RmiComponentAutoConfiguration extends AllNestedConditions { +public class RmiComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RmiComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class RmiComponentAutoConfiguration extends AllNestedConditions { @Autowired private RmiComponentConfiguration componentConfiguration; - public RmiComponentAutoConfiguration() { - 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.rmi"); } } @Lazy @Bean(name = "rmi-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RmiComponent.class) public RmiComponent configureRmiComponent() throws Exception { RmiComponent component = new RmiComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-routebox-starter/src/main/java/org/apache/camel/component/routebox/springboot/RouteboxComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-routebox-starter/src/main/java/org/apache/camel/component/routebox/springboot/RouteboxComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-routebox-starter/src/main/java/org/apache/camel/component/routebox/springboot/RouteboxComponentAutoConfiguration.java index d42cf8c..485e275 100644 --- a/platforms/spring-boot/components-starter/camel-routebox-starter/src/main/java/org/apache/camel/component/routebox/springboot/RouteboxComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-routebox-starter/src/main/java/org/apache/camel/component/routebox/springboot/RouteboxComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.routebox.RouteboxComponent; 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(RouteboxComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RouteboxComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, RouteboxComponentConfiguration.class}) -public class RouteboxComponentAutoConfiguration extends AllNestedConditions { +public class RouteboxComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RouteboxComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class RouteboxComponentAutoConfiguration extends AllNestedConditions { @Autowired private RouteboxComponentConfiguration componentConfiguration; - public RouteboxComponentAutoConfiguration() { - 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.routebox"); } } @Lazy @Bean(name = "routebox-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RouteboxComponent.class) public RouteboxComponent configureRouteboxComponent() throws Exception { RouteboxComponent component = new RouteboxComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/component/rss/springboot/RssComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/component/rss/springboot/RssComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/component/rss/springboot/RssComponentAutoConfiguration.java index ec3a296..68b78e5 100644 --- a/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/component/rss/springboot/RssComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/component/rss/springboot/RssComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.rss.RssComponent; 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(RssComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RssComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, RssComponentConfiguration.class}) -public class RssComponentAutoConfiguration extends AllNestedConditions { +public class RssComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RssComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class RssComponentAutoConfiguration extends AllNestedConditions { @Autowired private RssComponentConfiguration componentConfiguration; - public RssComponentAutoConfiguration() { - 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.rss"); } } @Lazy @Bean(name = "rss-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RssComponent.class) public RssComponent configureRssComponent() throws Exception { RssComponent component = new RssComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java index 4766b19..faa4347 100644 --- a/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-rss-starter/src/main/java/org/apache/camel/dataformat/rss/springboot/RssDataFormatAutoConfiguration.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(RssDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RssDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, RssDataFormatConfiguration.class}) -public class RssDataFormatAutoConfiguration extends AllNestedConditions { +public class RssDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RssDataFormatAutoConfiguration.class); @@ -67,30 +67,17 @@ public class RssDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private RssDataFormatConfiguration dataformatConfiguration; - public RssDataFormatAutoConfiguration() { - 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.rss"); } } @Bean(name = "rss-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(RssDataFormat.class) public DataFormatFactory configureRssDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { RssDataFormat dataformat = new RssDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentAutoConfiguration.java index e26d4a1..0f69a4c 100644 --- a/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.salesforce.SalesforceComponent; 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(SalesforceComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SalesforceComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SalesforceComponentConfiguration.class}) -public class SalesforceComponentAutoConfiguration extends AllNestedConditions { +public class SalesforceComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SalesforceComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SalesforceComponentAutoConfiguration extends AllNestedConditions { @Autowired private SalesforceComponentConfiguration componentConfiguration; - public SalesforceComponentAutoConfiguration() { - 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.salesforce"); } } @Lazy @Bean(name = "salesforce-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SalesforceComponent.class) public SalesforceComponent configureSalesforceComponent() throws Exception { SalesforceComponent component = new SalesforceComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-sap-netweaver-starter/src/main/java/org/apache/camel/component/sap/netweaver/springboot/NetWeaverComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-sap-netweaver-starter/src/main/java/org/apache/camel/component/sap/netweaver/springboot/NetWeaverComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-sap-netweaver-starter/src/main/java/org/apache/camel/component/sap/netweaver/springboot/NetWeaverComponentAutoConfiguration.java index 59021cc..ab4e685 100644 --- a/platforms/spring-boot/components-starter/camel-sap-netweaver-starter/src/main/java/org/apache/camel/component/sap/netweaver/springboot/NetWeaverComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-sap-netweaver-starter/src/main/java/org/apache/camel/component/sap/netweaver/springboot/NetWeaverComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.sap.netweaver.NetWeaverComponent; 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(NetWeaverComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + NetWeaverComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, NetWeaverComponentConfiguration.class}) -public class NetWeaverComponentAutoConfiguration extends AllNestedConditions { +public class NetWeaverComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(NetWeaverComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class NetWeaverComponentAutoConfiguration extends AllNestedConditions { @Autowired private NetWeaverComponentConfiguration componentConfiguration; - public NetWeaverComponentAutoConfiguration() { - 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.sap-netweaver"); } } @Lazy @Bean(name = "sap-netweaver-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(NetWeaverComponent.class) public NetWeaverComponent configureNetWeaverComponent() throws Exception { NetWeaverComponent component = new NetWeaverComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/component/xquery/springboot/XQueryComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/component/xquery/springboot/XQueryComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/component/xquery/springboot/XQueryComponentAutoConfiguration.java index d9bffd8..0d3b3ce 100644 --- a/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/component/xquery/springboot/XQueryComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/component/xquery/springboot/XQueryComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.xquery.XQueryComponent; 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(XQueryComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + XQueryComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, XQueryComponentConfiguration.class}) -public class XQueryComponentAutoConfiguration extends AllNestedConditions { +public class XQueryComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(XQueryComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class XQueryComponentAutoConfiguration extends AllNestedConditions { @Autowired private XQueryComponentConfiguration componentConfiguration; - public XQueryComponentAutoConfiguration() { - 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.xquery"); } } @Lazy @Bean(name = "xquery-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(XQueryComponent.class) public XQueryComponent configureXQueryComponent() throws Exception { XQueryComponent component = new XQueryComponent();