use of cn.taketoday.context.annotation.Bean in project today-framework by TAKETODAY.
the class TransactionManagerConfiguration method transactionManager2.
@Bean
@NoSynch
public PlatformTransactionManager transactionManager2() {
CallCountingTransactionManager tm = new CallCountingTransactionManager();
tm.setTransactionSynchronization(CallCountingTransactionManager.SYNCHRONIZATION_NEVER);
return tm;
}
use of cn.taketoday.context.annotation.Bean 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.Bean in project today-framework by TAKETODAY.
the class FactoryMethodComponent method protectedInstance.
@Bean
@BeanAge(1)
protected TestBean protectedInstance(@Qualifier("public") TestBean spouse, @Value("#{privateInstance.age}") String country) {
TestBean tb = new TestBean("protectedInstance", 1);
tb.setSpouse(tb);
tb.setCountry(country);
return tb;
}
use of cn.taketoday.context.annotation.Bean in project today-framework by TAKETODAY.
the class JdbcTemplateConfiguration method jdbcTemplate.
@Bean
@Primary
JdbcTemplate jdbcTemplate(DataSource dataSource, JdbcProperties properties) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
JdbcProperties.Template template = properties.getTemplate();
jdbcTemplate.setFetchSize(template.getFetchSize());
jdbcTemplate.setMaxRows(template.getMaxRows());
if (template.getQueryTimeout() != null) {
jdbcTemplate.setQueryTimeout((int) template.getQueryTimeout().getSeconds());
}
return jdbcTemplate;
}
use of cn.taketoday.context.annotation.Bean 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;
}
Aggregations