use of cn.taketoday.context.annotation.Role in project today-infrastructure by TAKETODAY.
the class ProxyJCacheConfiguration method cacheInterceptor.
@Bean(name = "jCacheInterceptor")
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public JCacheInterceptor cacheInterceptor(JCacheOperationSource jCacheOperationSource) {
JCacheInterceptor interceptor = new JCacheInterceptor(this.errorHandler);
interceptor.setCacheOperationSource(jCacheOperationSource);
return interceptor;
}
use of cn.taketoday.context.annotation.Role in project today-infrastructure by TAKETODAY.
the class ProxyJCacheConfiguration method cacheAdvisor.
@Bean(name = CacheManagementConfigUtils.JCACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryJCacheOperationSourceAdvisor cacheAdvisor(JCacheOperationSource jCacheOperationSource, JCacheInterceptor jCacheInterceptor) {
BeanFactoryJCacheOperationSourceAdvisor advisor = new BeanFactoryJCacheOperationSourceAdvisor();
advisor.setCacheOperationSource(jCacheOperationSource);
advisor.setAdvice(jCacheInterceptor);
if (this.enableCaching != null) {
advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
}
return advisor;
}
use of cn.taketoday.context.annotation.Role in project today-infrastructure by TAKETODAY.
the class ProxyTransactionManagementConfiguration method transactionAdvisor.
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Component(TransactionManagementConfigUtils.TRANSACTION_ADVISOR_BEAN_NAME)
public BeanFactoryTransactionAttributeSourceAdvisor transactionAdvisor(TransactionAttributeSource transactionAttributeSource, TransactionInterceptor transactionInterceptor) {
BeanFactoryTransactionAttributeSourceAdvisor advisor = new BeanFactoryTransactionAttributeSourceAdvisor();
advisor.setTransactionAttributeSource(transactionAttributeSource);
advisor.setAdvice(transactionInterceptor);
if (this.enableTx != null) {
advisor.setOrder(this.enableTx.getInt("order"));
}
return advisor;
}
use of cn.taketoday.context.annotation.Role in project today-framework by TAKETODAY.
the class ProxyCachingConfiguration method cacheEvictInterceptor.
@Aspect
@Component
@ConditionalOnMissingBean
@Advice(CacheEvict.class)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
CacheEvictInterceptor cacheEvictInterceptor(CacheManager cacheManager, CacheExpressionOperations operations) {
CacheEvictInterceptor cacheEvictInterceptor = new CacheEvictInterceptor(cacheManager);
cacheEvictInterceptor.setExpressionOperations(operations);
return cacheEvictInterceptor;
}
use of cn.taketoday.context.annotation.Role in project today-framework by TAKETODAY.
the class ProxyCachingConfiguration method cacheableInterceptor.
@Aspect
@Component
@Advice(Cacheable.class)
@ConditionalOnMissingBean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
CacheableInterceptor cacheableInterceptor(CacheManager cacheManager, CacheExpressionOperations operations) {
CacheableInterceptor cacheableInterceptor = new CacheableInterceptor(cacheManager);
cacheableInterceptor.setExpressionOperations(operations);
return cacheableInterceptor;
}
Aggregations