use of org.springframework.context.annotation.Bean in project spring-boot by spring-projects.
the class ArtemisEmbeddedServerConfiguration method artemisServer.
@Bean(initMethod = "start", destroyMethod = "stop")
@ConditionalOnMissingBean
public EmbeddedJMS artemisServer(org.apache.activemq.artemis.core.config.Configuration configuration, JMSConfiguration jmsConfiguration) {
EmbeddedJMS server = new EmbeddedJMS();
customize(configuration);
server.setConfiguration(configuration);
server.setJmsConfiguration(jmsConfiguration);
server.setRegistry(new ArtemisNoOpBindingRegistry());
return server;
}
use of org.springframework.context.annotation.Bean in project spring-boot by spring-projects.
the class EmbeddedLdapAutoConfiguration method ldapContextSource.
@Bean
@DependsOn("directoryServer")
@ConditionalOnMissingBean
public ContextSource ldapContextSource() {
LdapContextSource source = new LdapContextSource();
if (hasCredentials(this.embeddedProperties.getCredential())) {
source.setUserDn(this.embeddedProperties.getCredential().getUsername());
source.setPassword(this.embeddedProperties.getCredential().getPassword());
}
source.setUrls(this.properties.determineUrls(this.environment));
return source;
}
use of org.springframework.context.annotation.Bean in project spring-framework by spring-projects.
the class ProxyJCacheConfiguration method cacheInterceptor.
@Bean(name = "jCacheInterceptor")
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public JCacheInterceptor cacheInterceptor() {
JCacheInterceptor interceptor = new JCacheInterceptor();
interceptor.setCacheOperationSource(cacheOperationSource());
if (this.errorHandler != null) {
interceptor.setErrorHandler(this.errorHandler);
}
return interceptor;
}
use of org.springframework.context.annotation.Bean in project spring-framework by spring-projects.
the class ProxyCachingConfiguration method cacheAdvisor.
@Bean(name = CacheManagementConfigUtils.CACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryCacheOperationSourceAdvisor cacheAdvisor() {
BeanFactoryCacheOperationSourceAdvisor advisor = new BeanFactoryCacheOperationSourceAdvisor();
advisor.setCacheOperationSource(cacheOperationSource());
advisor.setAdvice(cacheInterceptor());
advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
return advisor;
}
use of org.springframework.context.annotation.Bean in project spring-framework by spring-projects.
the class AbstractMessageBrokerConfiguration method brokerChannelExecutor.
@Bean
public ThreadPoolTaskExecutor brokerChannelExecutor() {
ChannelRegistration reg = getBrokerRegistry().getBrokerChannelRegistration();
ThreadPoolTaskExecutor executor;
if (reg.hasTaskExecutor()) {
executor = reg.taskExecutor().getTaskExecutor();
} else {
// Should never be used
executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(0);
executor.setMaxPoolSize(1);
executor.setQueueCapacity(0);
}
executor.setThreadNamePrefix("brokerChannel-");
return executor;
}
Aggregations