Java Code Examples for org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor

The following examples show how to use org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note   Source File: ProxyJCacheConfiguration.java    License: MIT License 5 votes vote down vote up
@Bean(name = CacheManagementConfigUtils.JCACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryJCacheOperationSourceAdvisor cacheAdvisor() {
	BeanFactoryJCacheOperationSourceAdvisor advisor =
			new BeanFactoryJCacheOperationSourceAdvisor();
	advisor.setCacheOperationSource(cacheOperationSource());
	advisor.setAdvice(cacheInterceptor());
	if (this.enableCaching != null) {
		advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
	}
	return advisor;
}
 
Example 2
Source Project: java-technology-stack   Source File: ProxyJCacheConfiguration.java    License: MIT License 5 votes vote down vote up
@Bean(name = CacheManagementConfigUtils.JCACHE_ADVISOR_BEAN_NAME)
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public BeanFactoryJCacheOperationSourceAdvisor cacheAdvisor() {
	BeanFactoryJCacheOperationSourceAdvisor advisor =
			new BeanFactoryJCacheOperationSourceAdvisor();
	advisor.setCacheOperationSource(cacheOperationSource());
	advisor.setAdvice(cacheInterceptor());
	if (this.enableCaching != null) {
		advisor.setOrder(this.enableCaching.<Integer>getNumber("order"));
	}
	return advisor;
}
 
Example 3
@Override
public void initialize(GenericApplicationContext context) {
	context.registerBean(ProxyJCacheConfiguration.class, () -> new ProxyJCacheConfiguration());
	context.registerBean(BeanFactoryJCacheOperationSourceAdvisor.class,
			() -> context.getBean(ProxyJCacheConfiguration.class).cacheAdvisor(
					context.getBean(JCacheOperationSource.class), context.getBean(JCacheInterceptor.class)));
	context.registerBean(JCacheInterceptor.class, () -> context.getBean(ProxyJCacheConfiguration.class)
			.cacheInterceptor(context.getBean(JCacheOperationSource.class)));
	context.registerBean(JCacheOperationSource.class,
			() -> context.getBean(ProxyJCacheConfiguration.class).cacheOperationSource());
}
 
Example 4
@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;
}
 
Example 5
@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;
}