org.springframework.context.annotation.Lazy Java Examples

The following examples show how to use org.springframework.context.annotation.Lazy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultipleOpenApiWebFluxConfiguration.java    From springdoc-openapi with Apache License 2.0 6 votes vote down vote up
/**
 * Multiple open api resource multiple open api resource.
 *
 * @param groupedOpenApis the grouped open apis 
 * @param defaultOpenAPIBuilder the default open api builder 
 * @param requestBuilder the request builder 
 * @param responseBuilder the response builder 
 * @param operationParser the operation parser 
 * @param requestMappingHandlerMapping the request mapping handler mapping 
 * @param springDocConfigProperties the spring doc config properties 
 * @param actuatorProvider the actuator provider 
 * @return the multiple open api resource
 */
@Bean
@ConditionalOnMissingBean
@Lazy(false)
MultipleOpenApiResource multipleOpenApiResource(List<GroupedOpenApi> groupedOpenApis,
		ObjectFactory<OpenAPIBuilder> defaultOpenAPIBuilder, AbstractRequestBuilder requestBuilder,
		GenericResponseBuilder responseBuilder, OperationBuilder operationParser,
		RequestMappingInfoHandlerMapping requestMappingHandlerMapping,
		SpringDocConfigProperties springDocConfigProperties,
		Optional<ActuatorProvider> actuatorProvider) {
	return new MultipleOpenApiResource(groupedOpenApis,
			defaultOpenAPIBuilder, requestBuilder,
			responseBuilder, operationParser,
			requestMappingHandlerMapping,
			springDocConfigProperties,
			actuatorProvider);
}
 
Example #2
Source File: KinesisFirehose2ComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "aws2-kinesis-firehose-component")
@ConditionalOnMissingBean(KinesisFirehose2Component.class)
public KinesisFirehose2Component configureKinesisFirehose2Component()
        throws Exception {
    KinesisFirehose2Component component = new KinesisFirehose2Component();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<KinesisFirehose2Component> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.aws2-kinesis-firehose.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.aws2-kinesis-firehose.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #3
Source File: RestTemplateConfig.java    From log-trace-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean
@Primary
@LoadBalanced
public RestTemplate restTemplate() {
    return new RestTemplate();
}
 
Example #4
Source File: WeatherComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "weather-component")
@ConditionalOnMissingBean(WeatherComponent.class)
public WeatherComponent configureWeatherComponent() throws Exception {
    WeatherComponent component = new WeatherComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<WeatherComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.weather.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.weather.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #5
Source File: BrowseComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "browse-component")
@ConditionalOnMissingBean(BrowseComponent.class)
public BrowseComponent configureBrowseComponent() throws Exception {
    BrowseComponent component = new BrowseComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<BrowseComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.browse.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.browse.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #6
Source File: QueueServiceComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "azure-queue-component")
@ConditionalOnMissingBean(QueueServiceComponent.class)
public QueueServiceComponent configureQueueServiceComponent()
        throws Exception {
    QueueServiceComponent component = new QueueServiceComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<QueueServiceComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.azure-queue.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.azure-queue.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #7
Source File: AtomComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "atom-component")
@ConditionalOnMissingBean(AtomComponent.class)
public AtomComponent configureAtomComponent() throws Exception {
    AtomComponent component = new AtomComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<AtomComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.atom.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.atom.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #8
Source File: XmlVerifierComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "xmlsecurity-verify-component")
@ConditionalOnMissingBean(XmlVerifierComponent.class)
public XmlVerifierComponent configureXmlVerifierComponent() throws Exception {
    XmlVerifierComponent component = new XmlVerifierComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<XmlVerifierComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.xmlsecurity-verify.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.xmlsecurity-verify.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #9
Source File: JiraComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "jira-component")
@ConditionalOnMissingBean(JiraComponent.class)
public JiraComponent configureJiraComponent() throws Exception {
    JiraComponent component = new JiraComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<JiraComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jira.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jira.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #10
Source File: ElsqlComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "elsql-component")
@ConditionalOnMissingBean(ElsqlComponent.class)
public ElsqlComponent configureElsqlComponent() throws Exception {
    ElsqlComponent component = new ElsqlComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<ElsqlComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.elsql.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.elsql.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #11
Source File: ServiceNowComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "servicenow-component")
@ConditionalOnMissingBean(ServiceNowComponent.class)
public ServiceNowComponent configureServiceNowComponent() throws Exception {
    ServiceNowComponent component = new ServiceNowComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<ServiceNowComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.servicenow.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.servicenow.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #12
Source File: FhirComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "fhir-component")
@ConditionalOnMissingBean(FhirComponent.class)
public FhirComponent configureFhirComponent() throws Exception {
    FhirComponent component = new FhirComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<FhirComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.fhir.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.fhir.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #13
Source File: BlobServiceComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "azure-blob-component")
@ConditionalOnMissingBean(BlobServiceComponent.class)
public BlobServiceComponent configureBlobServiceComponent() throws Exception {
    BlobServiceComponent component = new BlobServiceComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<BlobServiceComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.azure-blob.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.azure-blob.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #14
Source File: CamelCloudServiceCallSimpleExpressionTest.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
@Lazy(false)
public MutablePropertySources springBootPropertySource() {

    MutablePropertySources sources = env.getPropertySources();
    sources.addFirst(new PropertiesPropertySource("boot-test-property", CamelCloudServiceCallSimpleExpressionTest.getAllProperties()));
    return sources;

}
 
Example #15
Source File: Jt400ComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "jt400-component")
@ConditionalOnMissingBean(Jt400Component.class)
public Jt400Component configureJt400Component() throws Exception {
    Jt400Component component = new Jt400Component();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<Jt400Component> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jt400.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jt400.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #16
Source File: ECSComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "aws-ecs-component")
@ConditionalOnMissingBean(ECSComponent.class)
public ECSComponent configureECSComponent() throws Exception {
    ECSComponent component = new ECSComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<ECSComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.aws-ecs.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.aws-ecs.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #17
Source File: JGroupsComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "jgroups-component")
@ConditionalOnMissingBean(JGroupsComponent.class)
public JGroupsComponent configureJGroupsComponent() throws Exception {
    JGroupsComponent component = new JGroupsComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<JGroupsComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jgroups.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jgroups.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #18
Source File: JMXComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "jmx-component")
@ConditionalOnMissingBean(JMXComponent.class)
public JMXComponent configureJMXComponent() throws Exception {
    JMXComponent component = new JMXComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<JMXComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jmx.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.jmx.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #19
Source File: NatsComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "nats-component")
@ConditionalOnMissingBean(NatsComponent.class)
public NatsComponent configureNatsComponent() throws Exception {
    NatsComponent component = new NatsComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<NatsComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.nats.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.nats.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #20
Source File: DebeziumMongodbComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "debezium-mongodb-component")
@ConditionalOnMissingBean(DebeziumMongodbComponent.class)
public DebeziumMongodbComponent configureDebeziumMongodbComponent()
        throws Exception {
    DebeziumMongodbComponent component = new DebeziumMongodbComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<DebeziumMongodbComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.debezium-mongodb.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.debezium-mongodb.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #21
Source File: ApnsComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "apns-component")
@ConditionalOnMissingBean(ApnsComponent.class)
public ApnsComponent configureApnsComponent() throws Exception {
    ApnsComponent component = new ApnsComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<ApnsComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.apns.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.apns.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #22
Source File: FlinkComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "flink-component")
@ConditionalOnMissingBean(FlinkComponent.class)
public FlinkComponent configureFlinkComponent() throws Exception {
    FlinkComponent component = new FlinkComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<FlinkComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.flink.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.flink.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #23
Source File: LdifComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "ldif-component")
@ConditionalOnMissingBean(LdifComponent.class)
public LdifComponent configureLdifComponent() throws Exception {
    LdifComponent component = new LdifComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<LdifComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.ldif.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.ldif.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #24
Source File: SftpComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "sftp-component")
@ConditionalOnMissingBean(SftpComponent.class)
public SftpComponent configureSftpComponent() throws Exception {
    SftpComponent component = new SftpComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<SftpComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.sftp.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.sftp.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #25
Source File: AWS2EC2ComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "aws2-ec2-component")
@ConditionalOnMissingBean(AWS2EC2Component.class)
public AWS2EC2Component configureAWS2EC2Component() throws Exception {
    AWS2EC2Component component = new AWS2EC2Component();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<AWS2EC2Component> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.aws2-ec2.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.aws2-ec2.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #26
Source File: CamelCloudServiceCallConfigurationAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = ServiceCallDefinitionConstants.DEFAULT_SERVICE_CALL_CONFIG_ID)
@ConditionalOnMissingBean(name = ServiceCallDefinitionConstants.DEFAULT_SERVICE_CALL_CONFIG_ID)
public ServiceCallConfigurationDefinition serviceCallConfiguration() throws Exception {
    final ServiceCallConfigurationDefinition definition = new ServiceCallConfigurationDefinition();
    final CamelCloudConfigurationProperties.ServiceCall serviceCall = configurationProperties.getServiceCall();

    ObjectHelper.ifNotEmpty(serviceCall.getComponent(), definition::setComponent);
    ObjectHelper.ifNotEmpty(serviceCall.getUri(), definition::setUri);
    ObjectHelper.ifNotEmpty(serviceCall.getServiceDiscovery(), definition::setServiceDiscoveryRef);
    ObjectHelper.ifNotEmpty(serviceCall.getServiceFilter(), definition::setServiceFilterRef);
    ObjectHelper.ifNotEmpty(serviceCall.getServiceChooser(), definition::setServiceChooserRef);
    ObjectHelper.ifNotEmpty(serviceCall.getLoadBalancer(), definition::setLoadBalancerRef);

    if (serviceCall.getLoadBalancer() == null && serviceCall.isDefaultLoadBalancer()) {
        definition.defaultLoadBalancer();
    }

    final String expression = serviceCall.getExpression();
    final String expressionLanguage = serviceCall.getExpressionLanguage();

    if (ObjectHelper.isNotEmpty(expression) && ObjectHelper.isNotEmpty(expressionLanguage)) {
        Language language = camelContext.resolveLanguage(expressionLanguage);
        if (language == null) {
            throw new IllegalArgumentException("Unable to resolve language: " + expressionLanguage);
        }

        definition.setExpression(language.createExpression(expression));
    }

    return definition;
}
 
Example #27
Source File: OpenshiftBuildsComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "openshift-builds-component")
@ConditionalOnMissingBean(OpenshiftBuildsComponent.class)
public OpenshiftBuildsComponent configureOpenshiftBuildsComponent()
        throws Exception {
    OpenshiftBuildsComponent component = new OpenshiftBuildsComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<OpenshiftBuildsComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.openshift-builds.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.openshift-builds.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #28
Source File: MiloServerComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "milo-server-component")
@ConditionalOnMissingBean(MiloServerComponent.class)
public MiloServerComponent configureMiloServerComponent() throws Exception {
    MiloServerComponent component = new MiloServerComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<MiloServerComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.milo-server.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.milo-server.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #29
Source File: ZendeskComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "zendesk-component")
@ConditionalOnMissingBean(ZendeskComponent.class)
public ZendeskComponent configureZendeskComponent() throws Exception {
    ZendeskComponent component = new ZendeskComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<ZendeskComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.zendesk.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.zendesk.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}
 
Example #30
Source File: RestSwaggerComponentAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Lazy
@Bean(name = "rest-swagger-component")
@ConditionalOnMissingBean(RestSwaggerComponent.class)
public RestSwaggerComponent configureRestSwaggerComponent() throws Exception {
    RestSwaggerComponent component = new RestSwaggerComponent();
    component.setCamelContext(camelContext);
    Map<String, Object> parameters = new HashMap<>();
    IntrospectionSupport.getProperties(configuration, parameters, null,
            false);
    CamelPropertiesHelper.setCamelProperties(camelContext, component,
            parameters, false);
    if (ObjectHelper.isNotEmpty(customizers)) {
        for (ComponentCustomizer<RestSwaggerComponent> customizer : customizers) {
            boolean useCustomizer = (customizer instanceof HasId)
                    ? HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.rest-swagger.customizer",
                            ((HasId) customizer).getId())
                    : HierarchicalPropertiesEvaluator.evaluate(
                            applicationContext.getEnvironment(),
                            "camel.component.customizer",
                            "camel.component.rest-swagger.customizer");
            if (useCustomizer) {
                LOGGER.debug("Configure component {}, with customizer {}",
                        component, customizer);
                customizer.customize(component);
            }
        }
    }
    return component;
}