@Bean(name = "jdbcMessageSourceDao")
@ConditionalOnMissingBean
public SimpleJdbcMessageSourceDao jdbcMessageSourceDa(DataSource dataSource) {
SimpleJdbcMessageSourceDao jdbcMessageSourceDao = new SimpleJdbcMessageSourceDao();
jdbcMessageSourceDao.setDataSource(dataSource);
if (hasText(getTableName())) {
jdbcMessageSourceDao.setTable(getTableName());
}
if (hasText(getMessageColumnName())) {
jdbcMessageSourceDao.setMessage(getMessageColumnName());
}
if (hasText(getTypeColumnName())) {
jdbcMessageSourceDao.setType(getTypeColumnName());
}
if (hasText(getCodeIdColumnName())) {
jdbcMessageSourceDao.setCodeId(getCodeIdColumnName());
}
if (hasText(getLangIdColumnName())) {
jdbcMessageSourceDao.setLangId(getLangIdColumnName());
}
return jdbcMessageSourceDao;
}
java类org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean的实例源码
SpringI18nSupportAutoConfiguration.java 文件源码
项目:spring-i18n-support
阅读 24
收藏 0
点赞 0
评论 0
ResourceServerTokenServicesConfiguration.java 文件源码
项目:spring-security-oauth2-boot
阅读 34
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean({ ConnectionFactoryLocator.class,
ResourceServerTokenServices.class })
public UserInfoTokenServices userInfoTokenServices() {
UserInfoTokenServices services = new UserInfoTokenServices(
this.sso.getUserInfoUri(), this.sso.getClientId());
services.setTokenType(this.sso.getTokenType());
services.setRestTemplate(this.restTemplate);
if (this.authoritiesExtractor != null) {
services.setAuthoritiesExtractor(this.authoritiesExtractor);
}
if (this.principalExtractor != null) {
services.setPrincipalExtractor(this.principalExtractor);
}
return services;
}
CasValidationConfiguration.java 文件源码
项目:cas-5.1.0
阅读 48
收藏 0
点赞 0
评论 0
@Autowired
@Bean
@ConditionalOnMissingBean(name = "proxyValidateController")
public ProxyValidateController proxyValidateController(@Qualifier("argumentExtractor") final ArgumentExtractor argumentExtractor,
@Qualifier("defaultAuthenticationSystemSupport")
final AuthenticationSystemSupport authenticationSystemSupport) {
final ProxyValidateController c = new ProxyValidateController();
c.setValidationSpecification(cas20ProtocolValidationSpecification);
c.setSuccessView(cas3ServiceSuccessView());
c.setFailureView(cas3ServiceFailureView);
c.setProxyHandler(proxy20Handler);
c.setAuthenticationSystemSupport(authenticationSystemSupport);
c.setServicesManager(servicesManager);
c.setCentralAuthenticationService(centralAuthenticationService);
c.setArgumentExtractor(argumentExtractor);
c.setMultifactorTriggerSelectionStrategy(multifactorTriggerSelectionStrategy);
c.setAuthenticationContextValidator(authenticationContextValidator);
c.setJsonView(cas3ServiceJsonView());
c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().getAuthenticationContextAttribute());
return c;
}
RocketMQAutoConfiguration.java 文件源码
项目:spring-boot-starter-rocketmq
阅读 31
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnClass(DefaultMQProducer.class)
@ConditionalOnMissingBean(DefaultMQProducer.class)
@ConditionalOnProperty(prefix = "spring.rocketmq", value = {"nameServer", "producer.group"})
public DefaultMQProducer mqProducer(RocketMQProperties rocketMQProperties) {
RocketMQProperties.Producer producerConfig = rocketMQProperties.getProducer();
String groupName = producerConfig.getGroup();
Assert.hasText(groupName, "[spring.rocketmq.producer.group] must not be null");
DefaultMQProducer producer = new DefaultMQProducer(producerConfig.getGroup());
producer.setNamesrvAddr(rocketMQProperties.getNameServer());
producer.setSendMsgTimeout(producerConfig.getSendMsgTimeout());
producer.setRetryTimesWhenSendFailed(producerConfig.getRetryTimesWhenSendFailed());
producer.setRetryTimesWhenSendAsyncFailed(producerConfig.getRetryTimesWhenSendAsyncFailed());
producer.setMaxMessageSize(producerConfig.getMaxMessageSize());
producer.setCompressMsgBodyOverHowmuch(producerConfig.getCompressMsgBodyOverHowmuch());
producer.setRetryAnotherBrokerWhenNotStoreOK(producerConfig.isRetryAnotherBrokerWhenNotStoreOk());
return producer;
}
TensorflowCommonProcessorConfiguration.java 文件源码
项目:tensorflow
阅读 28
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean(name = "tensorflowInputConverter")
@SuppressWarnings("unchecked")
public TensorflowInputConverter tensorflowInputConverter() {
return new TensorflowInputConverter() {
@Override
public Map<String, Object> convert(Object input, Map<String, Object> processorContext) {
if (input instanceof Map) {
return (Map<String, Object>) input;
}
throw new MessageConversionException("Unsupported input format: " + input);
}
};
}
CasPersonDirectoryConfiguration.java 文件源码
项目:cas-5.1.0
阅读 33
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(name = "attributeRepositories")
@Bean
@RefreshScope
public List<IPersonAttributeDao> attributeRepositories() {
final List<IPersonAttributeDao> list = new ArrayList<>();
list.addAll(ldapAttributeRepositories());
list.addAll(jdbcAttributeRepositories());
list.addAll(jsonAttributeRepositories());
list.addAll(groovyAttributeRepositories());
list.addAll(grouperAttributeRepositories());
list.addAll(stubAttributeRepositories());
OrderComparator.sort(list);
LOGGER.debug("Final list of attribute repositories is [{}]", list);
return list;
}
LoggerConfiguration.java 文件源码
项目:logger-spring-boot
阅读 23
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean(LoggerFormats.class)
public LoggerFormats loggerFormats() {
return LoggerFormats.builder()
.enter("#${method.name}(${method.args}): "
+ "entered")
.warnBefore("#${method.name}(${method.args}): "
+ "in ${method.duration} and still running (max ${method.warn.duration})")
.warnAfter("#${method.name}(${method.args}): "
+ "${method.result} in ${method.duration} (max ${method.warn.duration})")
.after("#${method.name}(${method.args}): "
+ "${method.result} in ${method.duration}")
.error("#${method.name}(${method.args}): "
+ "thrown ${error.class.name}(${error.message}) "
+ "from ${error.source.class.name}[${error.source.line}] in ${method.duration}")
.build();
}
TarantoolAutoConfiguration.java 文件源码
项目:data-tarantool-spring-boot-starter
阅读 26
收藏 0
点赞 0
评论 0
@Bean(destroyMethod = "close")
@ConditionalOnMissingBean(name = "tarantoolClient")
public TarantoolClient tarantoolClient(
SocketChannelProvider socketChannelProvider,
TarantoolClientConfig config
) {
return new TarantoolClientImpl(socketChannelProvider, config);
}
CasCoreWebflowConfiguration.java 文件源码
项目:cas-5.1.0
阅读 28
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(name = "multifactorAuthenticationProviderSelector")
@Bean
@RefreshScope
public MultifactorAuthenticationProviderSelector multifactorAuthenticationProviderSelector() {
final Resource script = casProperties.getAuthn().getMfa().getProviderSelectorGroovyScript();
if (script != null) {
return new GroovyScriptMultifactorAuthenticationProviderSelector(script);
}
return new RankedMultifactorAuthenticationProviderSelector();
}
NakadiProducerAutoConfiguration.java 文件源码
项目:nakadi-producer-spring-boot-starter
阅读 27
收藏 0
点赞 0
评论 0
@Bean(destroyMethod = "stop")
@ConditionalOnProperty({ "nakadi-producer.access-token-uri", "nakadi-producer.access-token-scopes" })
@ConditionalOnMissingBean(AccessTokenProvider.class)
public StupsTokenComponent accessTokenProvider(
@Value("${nakadi-producer.access-token-uri}") URI accessTokenUri,
@Value("${nakadi-producer.access-token-scopes}") String[] accessTokenScopes) {
return new StupsTokenComponent(accessTokenUri, Arrays.asList(accessTokenScopes));
}
MyBatisMigrationsAutoConfiguration.java 文件源码
项目:mybatis-migrations-spring-boot-autoconfigure
阅读 27
收藏 0
点赞 0
评论 0
/**
* CLI handler bean
* @param springApplicationArguments for CLI args
* @return constructed MyBatisMigrationsCliHandler bean
*/
@Bean(name = MY_BATIS_MIGRATIONS_CLI_HANDLER_BEAN)
@ConditionalOnMissingBean
public MyBatisMigrationsCliHandler myBatisMigrationsCliHandler(
ApplicationArguments springApplicationArguments) {
return new MyBatisMigrationsCliHandler(springApplicationArguments.getSourceArgs());
}
ActiveMQRespondMapConnectorAutoConfiguration.java 文件源码
项目:connectors
阅读 28
收藏 0
点赞 0
评论 0
@Lazy
@Bean(name = "activemq-respond-map-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ActiveMQRespondMapComponent configureActiveMQRespondMapComponent()
throws Exception {
ActiveMQRespondMapComponent connector = new ActiveMQRespondMapComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null,
false);
CamelPropertiesHelper.setCamelProperties(camelContext, connector,
parameters, false);
connector.setOptions(parameters);
if (ObjectHelper.isNotEmpty(customizers)) {
for (ConnectorCustomizer<ActiveMQRespondMapComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId)
? HierarchicalPropertiesEvaluator
.evaluate(
applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.activemq-respond-map.customizer",
((HasId) customizer).getId())
: HierarchicalPropertiesEvaluator
.evaluate(applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.activemq-respond-map.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}",
connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}
ClickHouseExporterAutoConfiguration.java 文件源码
项目:cmeter
阅读 28
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean
public ClickHouseDataSource clickHouseDataSource(Environment environment,
ClickHouseProperties clickHouseProperties) {
return new ClickHouseDataSource(
environment.getProperty("clickhouse.metrics.datasource.url", CLICKHOUSE_JDBC_URL),
clickHouseProperties);
}
CasSupportActionsConfiguration.java 文件源码
项目:cas-5.1.0
阅读 25
收藏 0
点赞 0
评论 0
@RefreshScope
@ConditionalOnMissingBean(name = "sendTicketGrantingTicketAction")
@Bean
public Action sendTicketGrantingTicketAction() {
return new SendTicketGrantingTicketAction(centralAuthenticationService, servicesManager, ticketGrantingTicketCookieGenerator,
casProperties.getSso().isRenewedAuthn());
}
WxWebConfiguration.java 文件源码
项目:FastBootWeixin
阅读 31
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean
public WxSessionManager wxSessionManager() {
return new DefaultWxSessionManager(wxProperties.getServer().getSessionTimeout(),
wxProperties.getServer().getMaxActiveLimit(),
BeanUtils.instantiate(wxProperties.getServer().getWxSessionIdGeneratorClass()));
}
CasCoreWebflowConfiguration.java 文件源码
项目:cas-5.1.0
阅读 27
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(name = "globalAuthenticationPolicyWebflowEventResolver")
@Bean
@RefreshScope
public CasWebflowEventResolver globalAuthenticationPolicyWebflowEventResolver() {
return new GlobalMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport,
centralAuthenticationService, servicesManager,
ticketRegistrySupport, warnCookieGenerator,
authenticationRequestServiceSelectionStrategies, selector, casProperties);
}
SalesforceDeleteSObjectConnectorAutoConfiguration.java 文件源码
项目:connectors
阅读 32
收藏 0
点赞 0
评论 0
@Lazy
@Bean(name = "salesforce-delete-sobject-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SalesforceDeleteSObjectComponent configureSalesforceDeleteSObjectComponent()
throws Exception {
SalesforceDeleteSObjectComponent connector = new SalesforceDeleteSObjectComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null,
false);
CamelPropertiesHelper.setCamelProperties(camelContext, connector,
parameters, false);
connector.setOptions(parameters);
if (ObjectHelper.isNotEmpty(customizers)) {
for (ConnectorCustomizer<SalesforceDeleteSObjectComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId)
? HierarchicalPropertiesEvaluator
.evaluate(
applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.salesforce-delete-sobject.customizer",
((HasId) customizer).getId())
: HierarchicalPropertiesEvaluator
.evaluate(applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.salesforce-delete-sobject.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}",
connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}
MapperAutoConfiguration.java 文件源码
项目:mapper-boot-starter
阅读 32
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean
public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
ExecutorType executorType = this.properties.getExecutorType();
if (executorType != null) {
return new SqlSessionTemplate(sqlSessionFactory, executorType);
} else {
return new SqlSessionTemplate(sqlSessionFactory);
}
}
CasCoreServicesConfiguration.java 文件源码
项目:cas-5.1.0
阅读 31
收藏 0
点赞 0
评论 0
@Autowired
@ConditionalOnMissingBean(name = "jsonServiceRegistryDao")
@Bean
public ServiceRegistryInitializer serviceRegistryInitializer(@Qualifier(BEAN_NAME_SERVICE_REGISTRY_DAO) final ServiceRegistryDao serviceRegistryDao) {
return new ServiceRegistryInitializer(embeddedJsonServiceRegistry(eventPublisher), serviceRegistryDao, servicesManager(serviceRegistryDao),
casProperties.getServiceRegistry().isInitFromJson());
}
MyJdbcAuthenticationHandlers.java 文件源码
项目:cas-overlay
阅读 25
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(
name = {"jdbcPrincipalFactory"}
)
@Bean
@RefreshScope
public PrincipalFactory jdbcPrincipalFactory() {
return new DefaultPrincipalFactory();
}
StorageAutoConfiguration.java 文件源码
项目:spring-cloud-gcp
阅读 25
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean
public static Storage storage(CredentialsProvider credentialsProvider,
GcpStorageProperties gcpStorageProperties) throws IOException {
return StorageOptions.newBuilder()
.setCredentials(gcpStorageProperties.getCredentials().getLocation() != null
? GoogleCredentials
.fromStream(gcpStorageProperties.getCredentials()
.getLocation().getInputStream())
.createScoped(gcpStorageProperties.getCredentials().getScopes())
: credentialsProvider.getCredentials())
.build().getService();
}
CasCoreAuditConfiguration.java 文件源码
项目:cas-5.1.0
阅读 30
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(name = "auditActionResolverMap")
@Bean
public Map<String, AuditActionResolver> auditActionResolverMap() {
final Map<String, AuditActionResolver> map = new HashMap<>();
final AuditActionResolver resolver = authenticationActionResolver();
map.put("AUTHENTICATION_RESOLVER", resolver);
map.put("SAVE_SERVICE_ACTION_RESOLVER", resolver);
map.put("CHANGE_PASSWORD_ACTION_RESOLVER", resolver);
final AuditActionResolver defResolver = new DefaultAuditActionResolver();
map.put("DESTROY_TICKET_GRANTING_TICKET_RESOLVER", defResolver);
map.put("DESTROY_PROXY_GRANTING_TICKET_RESOLVER", defResolver);
final AuditActionResolver cResolver = ticketCreationActionResolver();
map.put("CREATE_PROXY_GRANTING_TICKET_RESOLVER", cResolver);
map.put("GRANT_SERVICE_TICKET_RESOLVER", cResolver);
map.put("GRANT_PROXY_TICKET_RESOLVER", cResolver);
map.put("CREATE_TICKET_GRANTING_TICKET_RESOLVER", cResolver);
map.put("TRUSTED_AUTHENTICATION_ACTION_RESOLVER", cResolver);
map.put("AUTHENTICATION_EVENT_ACTION_RESOLVER", new DefaultAuditActionResolver("_TRIGGERED", StringUtils.EMPTY));
final AuditActionResolver adResolver = new DefaultAuditActionResolver();
map.put("ADAPTIVE_RISKY_AUTHENTICATION_ACTION_RESOLVER", adResolver);
map.put("VALIDATE_SERVICE_TICKET_RESOLVER", ticketValidationActionResolver());
return map;
}
SalesforceUpdateSObjectConnectorAutoConfiguration.java 文件源码
项目:connectors
阅读 36
收藏 0
点赞 0
评论 0
@Lazy
@Bean(name = "salesforce-update-sobject-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public SalesforceUpdateSObjectComponent configureSalesforceUpdateSObjectComponent()
throws Exception {
SalesforceUpdateSObjectComponent connector = new SalesforceUpdateSObjectComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null,
false);
CamelPropertiesHelper.setCamelProperties(camelContext, connector,
parameters, false);
connector.setOptions(parameters);
if (ObjectHelper.isNotEmpty(customizers)) {
for (ConnectorCustomizer<SalesforceUpdateSObjectComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId)
? HierarchicalPropertiesEvaluator
.evaluate(
applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.salesforce-update-sobject.customizer",
((HasId) customizer).getId())
: HierarchicalPropertiesEvaluator
.evaluate(applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.salesforce-update-sobject.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}",
connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}
ZuulWebSocketConfiguration.java 文件源码
项目:spring-cloud-netflix-zuul-websocket
阅读 34
收藏 0
点赞 0
评论 0
@Bean
@ConditionalOnMissingBean(ProxyWebSocketErrorHandler.class)
public ProxyWebSocketErrorHandler proxyWebSocketErrorHandler() {
Set<ProxyWebSocketErrorHandler> handlerSet = new HashSet<>();
handlerSet.add(new DefaultProxyWebSocketErrorHandler());
handlerSet.add(new ReconnectErrorHandler());
return new CompositeErrorHandler(handlerSet);
}
DayTradeGetConnectorAutoConfiguration.java 文件源码
项目:connectors
阅读 28
收藏 0
点赞 0
评论 0
@Lazy
@Bean(name = "day-trade-get-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public DayTradeGetComponent configureDayTradeGetComponent()
throws Exception {
DayTradeGetComponent connector = new DayTradeGetComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null,
false);
CamelPropertiesHelper.setCamelProperties(camelContext, connector,
parameters, false);
connector.setOptions(parameters);
if (ObjectHelper.isNotEmpty(customizers)) {
for (ConnectorCustomizer<DayTradeGetComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId)
? HierarchicalPropertiesEvaluator.evaluate(
applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.day-trade-get.customizer",
((HasId) customizer).getId())
: HierarchicalPropertiesEvaluator.evaluate(
applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.day-trade-get.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}",
connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}
CasCoreAuthenticationSupportConfiguration.java 文件源码
项目:cas-5.1.0
阅读 29
收藏 0
点赞 0
评论 0
@RefreshScope
@Bean
@ConditionalOnMissingBean(name = "authenticationContextValidator")
public AuthenticationContextValidator authenticationContextValidator() {
final String contextAttribute = casProperties.getAuthn().getMfa().getAuthenticationContextAttribute();
final String failureMode = casProperties.getAuthn().getMfa().getGlobalFailureMode();
final String authnAttributeName = casProperties.getAuthn().getMfa().getTrusted().getAuthenticationContextAttribute();
return new DefaultAuthenticationContextValidator(contextAttribute, failureMode, authnAttributeName);
}
CasManagementWebAppConfiguration.java 文件源码
项目:cas-5.1.0
阅读 31
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(name = "authorizationGenerator")
@Bean
@RefreshScope
public AuthorizationGenerator authorizationGenerator() {
final List<String> authzAttributes = casProperties.getMgmt().getAuthzAttributes();
if (!authzAttributes.isEmpty()) {
if ("*".equals(authzAttributes)) {
return new PermitAllAuthorizationGenerator();
}
return new FromAttributesAuthorizationGenerator(authzAttributes.toArray(new String[]{}), new String[]{});
}
return new SpringSecurityPropertiesAuthorizationGenerator(userProperties());
}
CasCoreLogoutConfiguration.java 文件源码
项目:cas-5.1.0
阅读 24
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(name = "defaultSingleLogoutServiceMessageHandler")
@Bean
public SingleLogoutServiceMessageHandler defaultSingleLogoutServiceMessageHandler() {
return new DefaultSingleLogoutServiceMessageHandler(httpClient,
logoutBuilder(),
servicesManager,
singleLogoutServiceLogoutUrlBuilder(),
casProperties.getSlo().isAsynchronous(),
authenticationRequestServiceSelectionStrategies);
}
ExternalShibbolethIdPAuthenticationServiceSelectionStrategyConfiguration.java 文件源码
项目:cas-5.1.0
阅读 23
收藏 0
点赞 0
评论 0
@ConditionalOnMissingBean(name = "shibbolethIdPEntityIdAuthenticationServiceSelectionStrategy")
@Bean
@RefreshScope
public AuthenticationServiceSelectionStrategy shibbolethIdPEntityIdAuthenticationServiceSelectionStrategy() {
return new ShibbolethIdPEntityIdAuthenticationServiceSelectionStrategy(webApplicationServiceFactory,
casProperties.getAuthn().getShibIdP().getServerUrl());
}
ActiveMQPublishConnectorAutoConfiguration.java 文件源码
项目:syndesis
阅读 30
收藏 0
点赞 0
评论 0
@Lazy
@Bean(name = "activemq-publish-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean
public ActiveMQPublishComponent configureActiveMQPublishComponent()
throws Exception {
ActiveMQPublishComponent connector = new ActiveMQPublishComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null,
false);
CamelPropertiesHelper.setCamelProperties(camelContext, connector,
parameters, false);
connector.setOptions(parameters);
if (ObjectHelper.isNotEmpty(customizers)) {
for (ConnectorCustomizer<ActiveMQPublishComponent> customizer : customizers) {
boolean useCustomizer = (customizer instanceof HasId)
? HierarchicalPropertiesEvaluator.evaluate(
applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.activemq-publish.customizer",
((HasId) customizer).getId())
: HierarchicalPropertiesEvaluator.evaluate(
applicationContext.getEnvironment(),
"camel.connector.customizer",
"camel.connector.activemq-publish.customizer");
if (useCustomizer) {
LOGGER.debug("Configure connector {}, with customizer {}",
connector, customizer);
customizer.customize(connector);
}
}
}
return connector;
}