Search in sources :

Example 51 with ConditionalOnMissingBean

use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.

the class SqsComponentAutoConfiguration method configureSqsComponent.

@Lazy
@Bean(name = "aws-sqs-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SqsComponent.class)
public SqsComponent configureSqsComponent(CamelContext camelContext) throws Exception {
    SqsComponent component = new SqsComponent();
    component.setCamelContext(camelContext);
    return component;
}
Also used : SqsComponent(org.apache.camel.component.aws.sqs.SqsComponent) Lazy(org.springframework.context.annotation.Lazy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 52 with ConditionalOnMissingBean

use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.

the class SWFComponentAutoConfiguration method configureSWFComponent.

@Lazy
@Bean(name = "aws-swf-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(SWFComponent.class)
public SWFComponent configureSWFComponent(CamelContext camelContext) throws Exception {
    SWFComponent component = new SWFComponent();
    component.setCamelContext(camelContext);
    return component;
}
Also used : SWFComponent(org.apache.camel.component.aws.swf.SWFComponent) Lazy(org.springframework.context.annotation.Lazy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 53 with ConditionalOnMissingBean

use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.

the class BlobServiceComponentAutoConfiguration method configureBlobServiceComponent.

@Lazy
@Bean(name = "azure-blob-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BlobServiceComponent.class)
public BlobServiceComponent configureBlobServiceComponent(CamelContext camelContext) throws Exception {
    BlobServiceComponent component = new BlobServiceComponent();
    component.setCamelContext(camelContext);
    return component;
}
Also used : BlobServiceComponent(org.apache.camel.component.azure.blob.BlobServiceComponent) Lazy(org.springframework.context.annotation.Lazy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 54 with ConditionalOnMissingBean

use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.

the class QueueServiceComponentAutoConfiguration method configureQueueServiceComponent.

@Lazy
@Bean(name = "azure-queue-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(QueueServiceComponent.class)
public QueueServiceComponent configureQueueServiceComponent(CamelContext camelContext) throws Exception {
    QueueServiceComponent component = new QueueServiceComponent();
    component.setCamelContext(camelContext);
    return component;
}
Also used : QueueServiceComponent(org.apache.camel.component.azure.queue.QueueServiceComponent) Lazy(org.springframework.context.annotation.Lazy) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 55 with ConditionalOnMissingBean

use of org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean in project camel by apache.

the class BarcodeDataFormatAutoConfiguration method configureBarcodeDataFormatFactory.

@Bean(name = "barcode-dataformat-factory")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(BarcodeDataFormat.class)
public DataFormatFactory configureBarcodeDataFormatFactory(final CamelContext camelContext, final BarcodeDataFormatConfiguration configuration) {
    return new DataFormatFactory() {

        public DataFormat newInstance() {
            BarcodeDataFormat dataformat = new BarcodeDataFormat();
            if (CamelContextAware.class.isAssignableFrom(BarcodeDataFormat.class)) {
                CamelContextAware contextAware = CamelContextAware.class.cast(dataformat);
                if (contextAware != null) {
                    contextAware.setCamelContext(camelContext);
                }
            }
            try {
                Map<String, Object> parameters = new HashMap<>();
                IntrospectionSupport.getProperties(configuration, parameters, null, false);
                IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), dataformat, parameters);
            } catch (Exception e) {
                throw new RuntimeCamelException(e);
            }
            return dataformat;
        }
    };
}
Also used : DataFormatFactory(org.apache.camel.spi.DataFormatFactory) BarcodeDataFormat(org.apache.camel.dataformat.barcode.BarcodeDataFormat) CamelContextAware(org.apache.camel.CamelContextAware) HashMap(java.util.HashMap) RuntimeCamelException(org.apache.camel.RuntimeCamelException) RuntimeCamelException(org.apache.camel.RuntimeCamelException) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)807 Bean (org.springframework.context.annotation.Bean)807 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)339 ConditionalOnClass (org.springframework.boot.autoconfigure.condition.ConditionalOnClass)298 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)251 Lazy (org.springframework.context.annotation.Lazy)227 lombok.val (lombok.val)210 HashMap (java.util.HashMap)190 Map (java.util.Map)113 CamelContextAware (org.apache.camel.CamelContextAware)69 RuntimeCamelException (org.apache.camel.RuntimeCamelException)45 DataFormatFactory (org.apache.camel.spi.DataFormatFactory)45 EnableConfigurationProperties (org.springframework.boot.context.properties.EnableConfigurationProperties)29 Scope (org.springframework.context.annotation.Scope)26 Autowired (org.springframework.beans.factory.annotation.Autowired)23 Configuration (org.springframework.context.annotation.Configuration)21 Qualifier (org.springframework.beans.factory.annotation.Qualifier)20 DefaultChainingMultifactorAuthenticationBypassProvider (org.apereo.cas.authentication.bypass.DefaultChainingMultifactorAuthenticationBypassProvider)19 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)19 AuthenticationMultifactorAuthenticationProviderBypassEvaluator (org.apereo.cas.authentication.bypass.AuthenticationMultifactorAuthenticationProviderBypassEvaluator)17