Java Code Examples for org.springframework.beans.factory.config.BeanDefinition#ROLE_INFRASTRUCTURE

The following examples show how to use org.springframework.beans.factory.config.BeanDefinition#ROLE_INFRASTRUCTURE . These examples are extracted from open source projects. 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
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheInterceptor cacheInterceptor() {
	CacheInterceptor interceptor = new CacheInterceptor();
	interceptor.setCacheOperationSources(cacheOperationSource());
	if (this.cacheResolver != null) {
		interceptor.setCacheResolver(this.cacheResolver);
	}
	else if (this.cacheManager != null) {
		interceptor.setCacheManager(this.cacheManager);
	}
	if (this.keyGenerator != null) {
		interceptor.setKeyGenerator(this.keyGenerator);
	}
	if (this.errorHandler != null) {
		interceptor.setErrorHandler(this.errorHandler);
	}
	return interceptor;
}
 
Example 2
@Bean(name = "jCacheOperationSource")
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public JCacheOperationSource cacheOperationSource() {
	DefaultJCacheOperationSource source = new DefaultJCacheOperationSource();
	if (this.cacheManager != null) {
		source.setCacheManager(this.cacheManager);
	}
	if (this.keyGenerator != null) {
		source.setKeyGenerator(this.keyGenerator);
	}
	if (this.cacheResolver != null) {
		source.setCacheResolver(this.cacheResolver);
	}
	if (this.exceptionCacheResolver != null) {
		source.setExceptionCacheResolver(this.exceptionCacheResolver);
	}
	return source;
}
 
Example 3
@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;
}
 
Example 4
@API(status = INTERNAL)
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnProperty(name = "opentracing.jdbc.enabled", havingValue = "true", matchIfMissing = true)
public static BeanPostProcessor tracingDataSourceBeanPostProcessor(final BeanFactory beanFactory) {
    return new TracingProcessor(beanFactory);
}
 
Example 5
@Bean(name = MBEAN_EXPORTER_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public AnnotationMBeanExporter mbeanExporter() {
	AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
	setupDomain(exporter);
	setupServer(exporter);
	setupRegistrationPolicy(exporter);
	return exporter;
}
 
Example 6
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public LimiterInterceptor limiterInterceptor() {
    LimiterInterceptor interceptor = new LimiterInterceptor();
    interceptor.setLimitedResourceSource(limitedResourceSource());
    return interceptor;
}
 
Example 7
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public TransactionInterceptor transactionInterceptor() {
	TransactionInterceptor interceptor = new TransactionInterceptor();
	interceptor.setTransactionAttributeSource(transactionAttributeSource());
	if (this.txManager != null) {
		interceptor.setTransactionManager(this.txManager);
	}
	return interceptor;
}
 
Example 8
@Bean(name = CacheManagementConfigUtils.JCACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryJCacheOperationSourceAdvisor cacheAdvisor() {
	BeanFactoryJCacheOperationSourceAdvisor advisor =
			new BeanFactoryJCacheOperationSourceAdvisor();
	advisor.setCacheOperationSource(cacheOperationSource());
	advisor.setAdvice(cacheInterceptor());
	advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
	return advisor;
}
 
Example 9
@Bean(name = MBEAN_EXPORTER_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public AnnotationMBeanExporter mbeanExporter() {
	AnnotationMBeanExporter exporter = new AnnotationMBeanExporter();
	Assert.state(this.enableMBeanExport != null, "No EnableMBeanExport annotation found");
	setupDomain(exporter, this.enableMBeanExport);
	setupServer(exporter, this.enableMBeanExport);
	setupRegistrationPolicy(exporter, this.enableMBeanExport);
	return exporter;
}
 
Example 10
@Bean(name = TaskManagementConfigUtils.ASYNC_ANNOTATION_PROCESSOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public AsyncAnnotationBeanPostProcessor asyncAdvisor() {
	Assert.notNull(this.enableAsync, "@EnableAsync annotation metadata was not injected");
	AsyncAnnotationBeanPostProcessor bpp = new AsyncAnnotationBeanPostProcessor();
	bpp.configure(this.executor, this.exceptionHandler);
	Class<? extends Annotation> customAsyncAnnotation = this.enableAsync.getClass("annotation");
	if (customAsyncAnnotation != AnnotationUtils.getDefaultValue(EnableAsync.class, "annotation")) {
		bpp.setAsyncAnnotationType(customAsyncAnnotation);
	}
	bpp.setProxyTargetClass(this.enableAsync.getBoolean("proxyTargetClass"));
	bpp.setOrder(this.enableAsync.<Integer>getNumber("order"));
	return bpp;
}
 
Example 11
@Bean(name = CacheAdvisor.CACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheAdvisor jetcacheAdvisor(JetCacheInterceptor jetCacheInterceptor) {
    CacheAdvisor advisor = new CacheAdvisor();
    advisor.setAdviceBeanName(CacheAdvisor.CACHE_ADVISOR_BEAN_NAME);
    advisor.setAdvice(jetCacheInterceptor);
    advisor.setBasePackages(this.enableMethodCache.getStringArray("basePackages"));
    advisor.setOrder(this.enableMethodCache.<Integer>getNumber("order"));
    return advisor;
}
 
Example 12
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public TransactionAttributeSource transactionAttributeSource() {
	return new AnnotationTransactionAttributeSource();
}
 
Example 13
@Bean(name = TransactionManagementConfigUtils.TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public static TransactionalEventListenerFactory transactionalEventListenerFactory() {
	return new TransactionalEventListenerFactory();
}
 
Example 14
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public TransactionAttributeSource transactionAttributeSource() {
	return new AnnotationTransactionAttributeSource();
}
 
Example 15
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheOperationSource cacheOperationSource() {
	return new AnnotationCacheOperationSource();
}
 
Example 16
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Description("A Bean method with a role")
public String bar() {
	return "bar";
}
 
Example 17
@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnClass(name = "reactor.core.publisher.Flux")
SleuthMethodInvocationProcessor reactorSleuthMethodInvocationProcessor() {
	return new ReactorSleuthMethodInvocationProcessor();
}
 
Example 18
@Bean(name = TransactionManagementConfigUtils.TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public TransactionalEventListenerFactory transactionalEventListenerFactory() {
	return new TransactionalEventListenerFactory();
}
 
Example 19
@Bean(name = BEAN_CONFIGURER_ASPECT_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public AnnotationBeanConfigurerAspect beanConfigurerAspect() {
	return AnnotationBeanConfigurerAspect.aspectOf();
}
 
Example 20
@Override
protected boolean isEligibleAdvisorBean(String beanName) {
	return (this.beanFactory != null && this.beanFactory.containsBeanDefinition(beanName) &&
			this.beanFactory.getBeanDefinition(beanName).getRole() == BeanDefinition.ROLE_INFRASTRUCTURE);
}