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/language/xquery/springboot/XQueryLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java index 64d1f67..cd18ed7 100644 --- a/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-saxon-starter/src/main/java/org/apache/camel/language/xquery/springboot/XQueryLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.language.xquery.XQueryLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(XQueryLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + XQueryLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, XQueryLanguageConfiguration.class}) -public class XQueryLanguageAutoConfiguration extends AllNestedConditions { +public class XQueryLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(XQueryLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class XQueryLanguageAutoConfiguration extends AllNestedConditions { @Autowired private XQueryLanguageConfiguration languageConfiguration; - public XQueryLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.xquery"); } } @Bean(name = "xquery-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(XQueryLanguage.class) public XQueryLanguage configureXQueryLanguage() throws Exception { XQueryLanguage language = new XQueryLanguage();
http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-schematron-starter/src/main/java/org/apache/camel/component/schematron/springboot/SchematronComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-schematron-starter/src/main/java/org/apache/camel/component/schematron/springboot/SchematronComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-schematron-starter/src/main/java/org/apache/camel/component/schematron/springboot/SchematronComponentAutoConfiguration.java index 3a5b076..5b7831e 100644 --- a/platforms/spring-boot/components-starter/camel-schematron-starter/src/main/java/org/apache/camel/component/schematron/springboot/SchematronComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-schematron-starter/src/main/java/org/apache/camel/component/schematron/springboot/SchematronComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.schematron.SchematronComponent; 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(SchematronComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SchematronComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SchematronComponentConfiguration.class}) -public class SchematronComponentAutoConfiguration extends AllNestedConditions { +public class SchematronComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SchematronComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SchematronComponentAutoConfiguration extends AllNestedConditions { @Autowired private SchematronComponentConfiguration componentConfiguration; - public SchematronComponentAutoConfiguration() { - 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.schematron"); } } @Lazy @Bean(name = "schematron-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SchematronComponent.class) public SchematronComponent configureSchematronComponent() throws Exception { SchematronComponent component = new SchematronComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/JavaScriptLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/JavaScriptLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/JavaScriptLanguageAutoConfiguration.java index 0ca7858..ebd9b83 100644 --- a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/JavaScriptLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/JavaScriptLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.builder.script.JavaScriptLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(JavaScriptLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + JavaScriptLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, JavaScriptLanguageConfiguration.class}) -public class JavaScriptLanguageAutoConfiguration extends AllNestedConditions { +public class JavaScriptLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(JavaScriptLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class JavaScriptLanguageAutoConfiguration extends AllNestedConditions { @Autowired private JavaScriptLanguageConfiguration languageConfiguration; - public JavaScriptLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.javascript"); } } @Bean(name = "javaScript-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(JavaScriptLanguage.class) public JavaScriptLanguage configureJavaScriptLanguage() throws Exception { JavaScriptLanguage language = new JavaScriptLanguage(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PhpLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PhpLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PhpLanguageAutoConfiguration.java index c410357..7b24d10 100644 --- a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PhpLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PhpLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.builder.script.PhpLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(PhpLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PhpLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, PhpLanguageConfiguration.class}) -public class PhpLanguageAutoConfiguration extends AllNestedConditions { +public class PhpLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PhpLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class PhpLanguageAutoConfiguration extends AllNestedConditions { @Autowired private PhpLanguageConfiguration languageConfiguration; - public PhpLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.php"); } } @Bean(name = "php-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(PhpLanguage.class) public PhpLanguage configurePhpLanguage() throws Exception { PhpLanguage language = new PhpLanguage(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PythonLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PythonLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PythonLanguageAutoConfiguration.java index cbd9763..e7387fd 100644 --- a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PythonLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/PythonLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.builder.script.PythonLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(PythonLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + PythonLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, PythonLanguageConfiguration.class}) -public class PythonLanguageAutoConfiguration extends AllNestedConditions { +public class PythonLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(PythonLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class PythonLanguageAutoConfiguration extends AllNestedConditions { @Autowired private PythonLanguageConfiguration languageConfiguration; - public PythonLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.python"); } } @Bean(name = "python-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(PythonLanguage.class) public PythonLanguage configurePythonLanguage() throws Exception { PythonLanguage language = new PythonLanguage(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/RubyLanguageAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/RubyLanguageAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/RubyLanguageAutoConfiguration.java index 1190050..ef9afb1 100644 --- a/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/RubyLanguageAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-script-starter/src/main/java/org/apache/camel/builder/script/springboot/RubyLanguageAutoConfiguration.java @@ -26,16 +26,16 @@ import org.apache.camel.builder.script.RubyLanguage; import org.apache.camel.spi.LanguageCustomizer; import org.apache.camel.spring.boot.CamelAutoConfiguration; import org.apache.camel.spring.boot.LanguageConfigurationProperties; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; import org.apache.camel.spring.boot.util.GroupCondition; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -48,11 +48,12 @@ import org.springframework.context.annotation.Scope; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(RubyLanguageAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + RubyLanguageAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({LanguageConfigurationProperties.class, RubyLanguageConfiguration.class}) -public class RubyLanguageAutoConfiguration extends AllNestedConditions { +public class RubyLanguageAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(RubyLanguageAutoConfiguration.class); @@ -65,28 +66,14 @@ public class RubyLanguageAutoConfiguration extends AllNestedConditions { @Autowired private RubyLanguageConfiguration languageConfiguration; - public RubyLanguageAutoConfiguration() { - super(ConfigurationPhase.REGISTER_BEAN); - } - - @ConditionalOnBean(CamelContext.class) - public static class OnCamelContext { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class OnCamelAutoConfiguration { - } - - @ConditionalOnBean(CamelAutoConfiguration.class) - public static class Condition extends GroupCondition { - public Condition() { + static class GroupConditions extends GroupCondition { + public GroupConditions() { super("camel.component", "camel.component.ruby"); } } @Bean(name = "ruby-language") - @Scope("prototype") - @ConditionalOnClass(CamelContext.class) + @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) @ConditionalOnMissingBean(RubyLanguage.class) public RubyLanguage configureRubyLanguage() throws Exception { RubyLanguage language = new RubyLanguage(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentAutoConfiguration.java index 9ee9722..57aa489 100644 --- a/platforms/spring-boot/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-servicenow-starter/src/main/java/org/apache/camel/component/servicenow/springboot/ServiceNowComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.servicenow.ServiceNowComponent; 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(ServiceNowComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + ServiceNowComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, ServiceNowComponentConfiguration.class}) -public class ServiceNowComponentAutoConfiguration extends AllNestedConditions { +public class ServiceNowComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(ServiceNowComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class ServiceNowComponentAutoConfiguration extends AllNestedConditions { @Autowired private ServiceNowComponentConfiguration componentConfiguration; - public ServiceNowComponentAutoConfiguration() { - 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.servicenow"); } } @Lazy @Bean(name = "servicenow-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ServiceNowComponent.class) public ServiceNowComponent configureServiceNowComponent() throws Exception { ServiceNowComponent component = new ServiceNowComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletComponentAutoConfiguration.java index 21a36d0..500c419 100644 --- a/platforms/spring-boot/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-servlet-starter/src/main/java/org/apache/camel/component/servlet/springboot/ServletComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.servlet.ServletComponent; 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(ServletComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + ServletComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, ServletComponentConfiguration.class}) -public class ServletComponentAutoConfiguration extends AllNestedConditions { +public class ServletComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(ServletComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class ServletComponentAutoConfiguration extends AllNestedConditions { @Autowired private ServletComponentConfiguration componentConfiguration; - public ServletComponentAutoConfiguration() { - 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.servlet"); } } @Lazy @Bean(name = "servlet-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(ServletComponent.class) public ServletComponent configureServletComponent() throws Exception { ServletComponent component = new ServletComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-sip-starter/src/main/java/org/apache/camel/component/sip/springboot/SipComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-sip-starter/src/main/java/org/apache/camel/component/sip/springboot/SipComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-sip-starter/src/main/java/org/apache/camel/component/sip/springboot/SipComponentAutoConfiguration.java index ac002fd..96e9329 100644 --- a/platforms/spring-boot/components-starter/camel-sip-starter/src/main/java/org/apache/camel/component/sip/springboot/SipComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-sip-starter/src/main/java/org/apache/camel/component/sip/springboot/SipComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.sip.SipComponent; 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(SipComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SipComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SipComponentConfiguration.class}) -public class SipComponentAutoConfiguration extends AllNestedConditions { +public class SipComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SipComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SipComponentAutoConfiguration extends AllNestedConditions { @Autowired private SipComponentConfiguration componentConfiguration; - public SipComponentAutoConfiguration() { - 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.sip"); } } @Lazy @Bean(name = {"sip-component", "sips-component"}) - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SipComponent.class) public SipComponent configureSipComponent() throws Exception { SipComponent component = new SipComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/batch/springboot/SjmsBatchComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/batch/springboot/SjmsBatchComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/batch/springboot/SjmsBatchComponentAutoConfiguration.java index 2f12efc..5844e7c 100644 --- a/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/batch/springboot/SjmsBatchComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/batch/springboot/SjmsBatchComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.sjms.batch.SjmsBatchComponent; 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(SjmsBatchComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SjmsBatchComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SjmsBatchComponentConfiguration.class}) -public class SjmsBatchComponentAutoConfiguration extends AllNestedConditions { +public class SjmsBatchComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SjmsBatchComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SjmsBatchComponentAutoConfiguration extends AllNestedConditions { @Autowired private SjmsBatchComponentConfiguration componentConfiguration; - public SjmsBatchComponentAutoConfiguration() { - 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.sjms-batch"); } } @Lazy @Bean(name = "sjms-batch-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SjmsBatchComponent.class) public SjmsBatchComponent configureSjmsBatchComponent() throws Exception { SjmsBatchComponent component = new SjmsBatchComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/springboot/SjmsComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/springboot/SjmsComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/springboot/SjmsComponentAutoConfiguration.java index 8eb516a..ea9645d 100644 --- a/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/springboot/SjmsComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-sjms-starter/src/main/java/org/apache/camel/component/sjms/springboot/SjmsComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.sjms.SjmsComponent; 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(SjmsComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SjmsComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SjmsComponentConfiguration.class}) -public class SjmsComponentAutoConfiguration extends AllNestedConditions { +public class SjmsComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SjmsComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SjmsComponentAutoConfiguration extends AllNestedConditions { @Autowired private SjmsComponentConfiguration componentConfiguration; - public SjmsComponentAutoConfiguration() { - 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.sjms"); } } @Lazy @Bean(name = "sjms-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SjmsComponent.class) public SjmsComponent configureSjmsComponent() throws Exception { SjmsComponent component = new SjmsComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-sjms2-starter/src/main/java/org/apache/camel/component/sjms2/springboot/Sjms2ComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-sjms2-starter/src/main/java/org/apache/camel/component/sjms2/springboot/Sjms2ComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-sjms2-starter/src/main/java/org/apache/camel/component/sjms2/springboot/Sjms2ComponentAutoConfiguration.java index a4687a4..99859e5 100644 --- a/platforms/spring-boot/components-starter/camel-sjms2-starter/src/main/java/org/apache/camel/component/sjms2/springboot/Sjms2ComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-sjms2-starter/src/main/java/org/apache/camel/component/sjms2/springboot/Sjms2ComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.sjms2.Sjms2Component; 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(Sjms2ComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + Sjms2ComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, Sjms2ComponentConfiguration.class}) -public class Sjms2ComponentAutoConfiguration extends AllNestedConditions { +public class Sjms2ComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(Sjms2ComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class Sjms2ComponentAutoConfiguration extends AllNestedConditions { @Autowired private Sjms2ComponentConfiguration componentConfiguration; - public Sjms2ComponentAutoConfiguration() { - 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.sjms2"); } } @Lazy @Bean(name = "sjms2-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(Sjms2Component.class) public Sjms2Component configureSjms2Component() throws Exception { Sjms2Component component = new Sjms2Component(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-slack-starter/src/main/java/org/apache/camel/component/slack/springboot/SlackComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-slack-starter/src/main/java/org/apache/camel/component/slack/springboot/SlackComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-slack-starter/src/main/java/org/apache/camel/component/slack/springboot/SlackComponentAutoConfiguration.java index 606b62f..abb0aa6 100644 --- a/platforms/spring-boot/components-starter/camel-slack-starter/src/main/java/org/apache/camel/component/slack/springboot/SlackComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-slack-starter/src/main/java/org/apache/camel/component/slack/springboot/SlackComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.slack.SlackComponent; 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(SlackComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SlackComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SlackComponentConfiguration.class}) -public class SlackComponentAutoConfiguration extends AllNestedConditions { +public class SlackComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SlackComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SlackComponentAutoConfiguration extends AllNestedConditions { @Autowired private SlackComponentConfiguration componentConfiguration; - public SlackComponentAutoConfiguration() { - 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.slack"); } } @Lazy @Bean(name = "slack-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SlackComponent.class) public SlackComponent configureSlackComponent() throws Exception { SlackComponent component = new SlackComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentAutoConfiguration.java index b4c1004..cf710f8 100644 --- a/platforms/spring-boot/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.smpp.SmppComponent; 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(SmppComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SmppComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SmppComponentConfiguration.class}) -public class SmppComponentAutoConfiguration extends AllNestedConditions { +public class SmppComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SmppComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SmppComponentAutoConfiguration extends AllNestedConditions { @Autowired private SmppComponentConfiguration componentConfiguration; - public SmppComponentAutoConfiguration() { - 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.smpp"); } } @Lazy @Bean(name = {"smpp-component", "smpps-component"}) - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SmppComponent.class) public SmppComponent configureSmppComponent() throws Exception { SmppComponent component = new SmppComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatAutoConfiguration.java index 98a9bdb..52a6014 100644 --- a/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-snakeyaml-starter/src/main/java/org/apache/camel/component/snakeyaml/springboot/SnakeYAMLDataFormatAutoConfiguration.java @@ -20,6 +20,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Generated; + import org.apache.camel.CamelContext; import org.apache.camel.CamelContextAware; import org.apache.camel.RuntimeCamelException; @@ -27,8 +28,8 @@ import org.apache.camel.component.snakeyaml.SnakeYAMLDataFormat; import org.apache.camel.spi.DataFormat; 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,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.AllNestedConditions; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -50,11 +48,12 @@ import org.springframework.context.annotation.Configuration; */ @Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") @Configuration -@Conditional(SnakeYAMLDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SnakeYAMLDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, SnakeYAMLDataFormatConfiguration.class}) -public class SnakeYAMLDataFormatAutoConfiguration extends AllNestedConditions { +public class SnakeYAMLDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SnakeYAMLDataFormatAutoConfiguration.class); @@ -67,31 +66,18 @@ public class SnakeYAMLDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private SnakeYAMLDataFormatConfiguration dataformatConfiguration; - public SnakeYAMLDataFormatAutoConfiguration() { - 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.yaml-snakeyaml"); } } @Bean(name = "yaml-snakeyaml-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SnakeYAMLDataFormat.class) public DataFormatFactory configureSnakeYAMLDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { SnakeYAMLDataFormat dataformat = new SnakeYAMLDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-snmp-starter/src/main/java/org/apache/camel/component/snmp/springboot/SnmpComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-snmp-starter/src/main/java/org/apache/camel/component/snmp/springboot/SnmpComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-snmp-starter/src/main/java/org/apache/camel/component/snmp/springboot/SnmpComponentAutoConfiguration.java index 896231a..8dfd1ad 100644 --- a/platforms/spring-boot/components-starter/camel-snmp-starter/src/main/java/org/apache/camel/component/snmp/springboot/SnmpComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-snmp-starter/src/main/java/org/apache/camel/component/snmp/springboot/SnmpComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.snmp.SnmpComponent; 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(SnmpComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SnmpComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SnmpComponentConfiguration.class}) -public class SnmpComponentAutoConfiguration extends AllNestedConditions { +public class SnmpComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SnmpComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SnmpComponentAutoConfiguration extends AllNestedConditions { @Autowired private SnmpComponentConfiguration componentConfiguration; - public SnmpComponentAutoConfiguration() { - 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.snmp"); } } @Lazy @Bean(name = "snmp-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SnmpComponent.class) public SnmpComponent configureSnmpComponent() throws Exception { SnmpComponent component = new SnmpComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatAutoConfiguration.java index 8f3e108..57f592b 100644 --- a/platforms/spring-boot/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-soap-starter/src/main/java/org/apache/camel/dataformat/soap/springboot/SoapJaxbDataFormatAutoConfiguration.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(SoapJaxbDataFormatAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SoapJaxbDataFormatAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") @EnableConfigurationProperties({DataFormatConfigurationProperties.class, SoapJaxbDataFormatConfiguration.class}) -public class SoapJaxbDataFormatAutoConfiguration extends AllNestedConditions { +public class SoapJaxbDataFormatAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SoapJaxbDataFormatAutoConfiguration.class); @@ -67,31 +67,18 @@ public class SoapJaxbDataFormatAutoConfiguration extends AllNestedConditions { @Autowired private SoapJaxbDataFormatConfiguration dataformatConfiguration; - public SoapJaxbDataFormatAutoConfiguration() { - 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.soapjaxb"); } } @Bean(name = "soapjaxb-dataformat-factory") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SoapJaxbDataFormat.class) public DataFormatFactory configureSoapJaxbDataFormatFactory() throws Exception { return new DataFormatFactory() { + @Override public DataFormat newInstance() { SoapJaxbDataFormat dataformat = new SoapJaxbDataFormat(); if (CamelContextAware.class http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-solr-starter/src/main/java/org/apache/camel/component/solr/springboot/SolrComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-solr-starter/src/main/java/org/apache/camel/component/solr/springboot/SolrComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-solr-starter/src/main/java/org/apache/camel/component/solr/springboot/SolrComponentAutoConfiguration.java index ce8dbd6..28726ff 100644 --- a/platforms/spring-boot/components-starter/camel-solr-starter/src/main/java/org/apache/camel/component/solr/springboot/SolrComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-solr-starter/src/main/java/org/apache/camel/component/solr/springboot/SolrComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.solr.SolrComponent; 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(SolrComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SolrComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SolrComponentConfiguration.class}) -public class SolrComponentAutoConfiguration extends AllNestedConditions { +public class SolrComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SolrComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SolrComponentAutoConfiguration extends AllNestedConditions { @Autowired private SolrComponentConfiguration componentConfiguration; - public SolrComponentAutoConfiguration() { - 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.solr"); } } @Lazy @Bean(name = {"solr-component", "solrCloud-component", "solrs-component"}) - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SolrComponent.class) public SolrComponent configureSolrComponent() throws Exception { SolrComponent component = new SolrComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-spark-starter/src/main/java/org/apache/camel/component/spark/springboot/SparkComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-spark-starter/src/main/java/org/apache/camel/component/spark/springboot/SparkComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-spark-starter/src/main/java/org/apache/camel/component/spark/springboot/SparkComponentAutoConfiguration.java index d9c9e91..875b3f0 100644 --- a/platforms/spring-boot/components-starter/camel-spark-starter/src/main/java/org/apache/camel/component/spark/springboot/SparkComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-spark-starter/src/main/java/org/apache/camel/component/spark/springboot/SparkComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.spark.SparkComponent; 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(SparkComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SparkComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SparkComponentConfiguration.class}) -public class SparkComponentAutoConfiguration extends AllNestedConditions { +public class SparkComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SparkComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SparkComponentAutoConfiguration extends AllNestedConditions { @Autowired private SparkComponentConfiguration componentConfiguration; - public SparkComponentAutoConfiguration() { - 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.spark"); } } @Lazy @Bean(name = "spark-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SparkComponent.class) public SparkComponent configureSparkComponent() throws Exception { SparkComponent component = new SparkComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-splunk-starter/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-splunk-starter/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-splunk-starter/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java index e4e6126..646635a 100644 --- a/platforms/spring-boot/components-starter/camel-splunk-starter/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-splunk-starter/src/main/java/org/apache/camel/component/splunk/springboot/SplunkComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.splunk.SplunkComponent; 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(SplunkComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SplunkComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SplunkComponentConfiguration.class}) -public class SplunkComponentAutoConfiguration extends AllNestedConditions { +public class SplunkComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SplunkComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SplunkComponentAutoConfiguration extends AllNestedConditions { @Autowired private SplunkComponentConfiguration componentConfiguration; - public SplunkComponentAutoConfiguration() { - 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.splunk"); } } @Lazy @Bean(name = "splunk-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SplunkComponent.class) public SplunkComponent configureSplunkComponent() throws Exception { SplunkComponent component = new SplunkComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-spring-batch-starter/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-spring-batch-starter/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-spring-batch-starter/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java index 03971b3..b41fa6b 100644 --- a/platforms/spring-boot/components-starter/camel-spring-batch-starter/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-spring-batch-starter/src/main/java/org/apache/camel/component/spring/batch/springboot/SpringBatchComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.spring.batch.SpringBatchComponent; 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(SpringBatchComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SpringBatchComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SpringBatchComponentConfiguration.class}) -public class SpringBatchComponentAutoConfiguration extends AllNestedConditions { +public class SpringBatchComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SpringBatchComponentAutoConfiguration.class); @@ -64,27 +64,14 @@ public class SpringBatchComponentAutoConfiguration extends AllNestedConditions { @Autowired private SpringBatchComponentConfiguration componentConfiguration; - public SpringBatchComponentAutoConfiguration() { - 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.spring-batch"); } } @Lazy @Bean(name = "spring-batch-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SpringBatchComponent.class) public SpringBatchComponent configureSpringBatchComponent() throws Exception { http://git-wip-us.apache.org/repos/asf/camel/blob/cd54a966/platforms/spring-boot/components-starter/camel-spring-integration-starter/src/main/java/org/apache/camel/component/spring/integration/springboot/SpringIntegrationComponentAutoConfiguration.java ---------------------------------------------------------------------- diff --git a/platforms/spring-boot/components-starter/camel-spring-integration-starter/src/main/java/org/apache/camel/component/spring/integration/springboot/SpringIntegrationComponentAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-spring-integration-starter/src/main/java/org/apache/camel/component/spring/integration/springboot/SpringIntegrationComponentAutoConfiguration.java index fd1ede3..931ae76 100644 --- a/platforms/spring-boot/components-starter/camel-spring-integration-starter/src/main/java/org/apache/camel/component/spring/integration/springboot/SpringIntegrationComponentAutoConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-spring-integration-starter/src/main/java/org/apache/camel/component/spring/integration/springboot/SpringIntegrationComponentAutoConfiguration.java @@ -25,6 +25,7 @@ import org.apache.camel.component.spring.integration.SpringIntegrationComponent; 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(SpringIntegrationComponentAutoConfiguration.Condition.class) +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + SpringIntegrationComponentAutoConfiguration.GroupConditions.class}) @AutoConfigureAfter(CamelAutoConfiguration.class) @EnableConfigurationProperties({ComponentConfigurationProperties.class, SpringIntegrationComponentConfiguration.class}) -public class SpringIntegrationComponentAutoConfiguration - extends - AllNestedConditions { +public class SpringIntegrationComponentAutoConfiguration { private static final Logger LOGGER = LoggerFactory .getLogger(SpringIntegrationComponentAutoConfiguration.class); @@ -66,27 +64,14 @@ public class SpringIntegrationComponentAutoConfiguration @Autowired private SpringIntegrationComponentConfiguration componentConfiguration; - public SpringIntegrationComponentAutoConfiguration() { - 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.spring-integration"); } } @Lazy @Bean(name = "spring-integration-component") - @ConditionalOnClass(CamelContext.class) @ConditionalOnMissingBean(SpringIntegrationComponent.class) public SpringIntegrationComponent configureSpringIntegrationComponent() throws Exception {