Search in sources :

Example 1 with BeanFactoryJCacheOperationSourceAdvisor

use of org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor in project spring-framework by spring-projects.

the class ProxyJCacheConfiguration method cacheAdvisor.

@Bean(name = CacheManagementConfigUtils.JCACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryJCacheOperationSourceAdvisor cacheAdvisor() {
    BeanFactoryJCacheOperationSourceAdvisor advisor = new BeanFactoryJCacheOperationSourceAdvisor();
    advisor.setCacheOperationSource(cacheOperationSource());
    advisor.setAdvice(cacheInterceptor());
    advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
    return advisor;
}
Also used : BeanFactoryJCacheOperationSourceAdvisor(org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Example 2 with BeanFactoryJCacheOperationSourceAdvisor

use of org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor in project spring-framework by spring-projects.

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(org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor) Role(org.springframework.context.annotation.Role) Bean(org.springframework.context.annotation.Bean)

Aggregations

BeanFactoryJCacheOperationSourceAdvisor (org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor)2 Bean (org.springframework.context.annotation.Bean)2 Role (org.springframework.context.annotation.Role)2