use of cn.taketoday.context.annotation.Role in project today-infrastructure 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;
}
use of cn.taketoday.context.annotation.Role in project today-infrastructure 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;
}
use of cn.taketoday.context.annotation.Role in project today-infrastructure 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;
}
use of cn.taketoday.context.annotation.Role in project today-framework 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-framework by TAKETODAY.
the class WebSessionConfig method sessionIdGenerator.
/**
* @since 4.0
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@ConditionalOnMissingBean(SessionIdGenerator.class)
SessionIdGenerator sessionIdGenerator(ServerProperties serverProperties) {
SecureRandomSessionIdGenerator generator = new SecureRandomSessionIdGenerator();
Session session = serverProperties.getSession();
generator.setLength(session.getSessionIdLength());
return generator;
}
Aggregations