Search in sources :

Example 11 with Role

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;
}
Also used : JCacheInterceptor(cn.taketoday.cache.jcache.interceptor.JCacheInterceptor) Role(cn.taketoday.context.annotation.Role) Bean(cn.taketoday.context.annotation.Bean)

Example 12 with Role

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;
}
Also used : BeanFactoryJCacheOperationSourceAdvisor(cn.taketoday.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor) Role(cn.taketoday.context.annotation.Role) Bean(cn.taketoday.context.annotation.Bean)

Example 13 with Role

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;
}
Also used : BeanFactoryTransactionAttributeSourceAdvisor(cn.taketoday.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor) Role(cn.taketoday.context.annotation.Role) Component(cn.taketoday.lang.Component)

Example 14 with Role

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;
}
Also used : CacheEvictInterceptor(cn.taketoday.cache.interceptor.CacheEvictInterceptor) Role(cn.taketoday.context.annotation.Role) ConditionalOnMissingBean(cn.taketoday.context.condition.ConditionalOnMissingBean) Advice(cn.taketoday.aop.support.annotation.Advice) Aspect(cn.taketoday.aop.support.annotation.Aspect) Component(cn.taketoday.lang.Component)

Example 15 with Role

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;
}
Also used : CacheableInterceptor(cn.taketoday.cache.interceptor.CacheableInterceptor) Role(cn.taketoday.context.annotation.Role) ConditionalOnMissingBean(cn.taketoday.context.condition.ConditionalOnMissingBean) Advice(cn.taketoday.aop.support.annotation.Advice) Aspect(cn.taketoday.aop.support.annotation.Aspect) Component(cn.taketoday.lang.Component)

Aggregations

Role (cn.taketoday.context.annotation.Role)16 Bean (cn.taketoday.context.annotation.Bean)8 Component (cn.taketoday.lang.Component)8 ConditionalOnMissingBean (cn.taketoday.context.condition.ConditionalOnMissingBean)4 Advice (cn.taketoday.aop.support.annotation.Advice)3 Aspect (cn.taketoday.aop.support.annotation.Aspect)3 BeanFactoryCacheOperationSourceAdvisor (cn.taketoday.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor)2 CacheInterceptor (cn.taketoday.cache.interceptor.CacheInterceptor)2 BeanFactoryJCacheOperationSourceAdvisor (cn.taketoday.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor)2 JCacheInterceptor (cn.taketoday.cache.jcache.interceptor.JCacheInterceptor)2 BeanFactoryTransactionAttributeSourceAdvisor (cn.taketoday.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor)2 TransactionInterceptor (cn.taketoday.transaction.interceptor.TransactionInterceptor)2 CacheEvictInterceptor (cn.taketoday.cache.interceptor.CacheEvictInterceptor)1 CachePutInterceptor (cn.taketoday.cache.interceptor.CachePutInterceptor)1 CacheableInterceptor (cn.taketoday.cache.interceptor.CacheableInterceptor)1 SecureRandomSessionIdGenerator (cn.taketoday.web.session.SecureRandomSessionIdGenerator)1