Search in sources :

Example 6 with Role

use of cn.taketoday.context.annotation.Role in project today-framework by TAKETODAY.

the class ProxyTransactionManagementConfiguration method transactionInterceptor.

@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public TransactionInterceptor transactionInterceptor(TransactionAttributeSource transactionAttributeSource) {
    TransactionInterceptor interceptor = new TransactionInterceptor();
    interceptor.setTransactionAttributeSource(transactionAttributeSource);
    if (this.txManager != null) {
        interceptor.setTransactionManager(this.txManager);
    }
    return interceptor;
}
Also used : TransactionInterceptor(cn.taketoday.transaction.interceptor.TransactionInterceptor) Role(cn.taketoday.context.annotation.Role) Component(cn.taketoday.lang.Component)

Example 7 with Role

use of cn.taketoday.context.annotation.Role in project today-framework 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 8 with Role

use of cn.taketoday.context.annotation.Role in project today-framework 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 9 with Role

use of cn.taketoday.context.annotation.Role in project today-framework by TAKETODAY.

the class ProxyCachingConfiguration method cacheInterceptor.

@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public CacheInterceptor cacheInterceptor(CacheOperationSource cacheOperationSource) {
    CacheInterceptor interceptor = new CacheInterceptor();
    interceptor.configure(this.errorHandler, this.keyGenerator, this.cacheResolver, this.cacheManager);
    interceptor.setCacheOperationSource(cacheOperationSource);
    return interceptor;
}
Also used : CacheInterceptor(cn.taketoday.cache.interceptor.CacheInterceptor) Role(cn.taketoday.context.annotation.Role) Bean(cn.taketoday.context.annotation.Bean)

Example 10 with Role

use of cn.taketoday.context.annotation.Role in project today-framework by TAKETODAY.

the class ProxyCachingConfiguration method cacheAdvisor.

@Bean(name = CacheManagementConfigUtils.CACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryCacheOperationSourceAdvisor cacheAdvisor(CacheOperationSource cacheOperationSource, CacheInterceptor cacheInterceptor) {
    BeanFactoryCacheOperationSourceAdvisor advisor = new BeanFactoryCacheOperationSourceAdvisor();
    advisor.setCacheOperationSource(cacheOperationSource);
    advisor.setAdvice(cacheInterceptor);
    if (this.enableCaching != null) {
        advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
    }
    return advisor;
}
Also used : BeanFactoryCacheOperationSourceAdvisor(cn.taketoday.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor) Role(cn.taketoday.context.annotation.Role) Bean(cn.taketoday.context.annotation.Bean)

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