use of cn.taketoday.context.annotation.Bean in project today-framework by TAKETODAY.
the class PojoAndStringConfig method employee.
@Bean
public Employee employee() {
Employee employee = new Employee();
employee.setName("John Smith");
employee.setAge(42);
employee.setCompany("Acme Widgets, Inc.");
return employee;
}
use of cn.taketoday.context.annotation.Bean 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.Bean 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.Bean in project today-infrastructure 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-infrastructure by TAKETODAY.
the class PojoAndStringConfig method employee.
@Bean
public Employee employee() {
Employee employee = new Employee();
employee.setName("John Smith");
employee.setAge(42);
employee.setCompany("Acme Widgets, Inc.");
return employee;
}
Aggregations