Search in sources :

Example 1 with BeanFactoryJCacheOperationSourceAdvisor

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

Example 2 with BeanFactoryJCacheOperationSourceAdvisor

use of cn.taketoday.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor 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)

Aggregations

BeanFactoryJCacheOperationSourceAdvisor (cn.taketoday.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor)2 Bean (cn.taketoday.context.annotation.Bean)2 Role (cn.taketoday.context.annotation.Role)2