Skip to content

Instantly share code, notes, and snippets.

@snicoll
Created February 26, 2014 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snicoll/9229148 to your computer and use it in GitHub Desktop.
Save snicoll/9229148 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="apc" class="org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator"/>
<bean id="annotationSource" class="org.springframework.cache.jcache.interceptor.DefaultJCacheOperationSource">
<property name="cacheManager" ref="cacheManager"/>
</bean>
<bean id="cacheInterceptor" class="org.springframework.cache.jcache.interceptor.JCacheInterceptor">
<property name="cacheOperationSource" ref="annotationSource"/>
</bean>
<bean id="advisor" class="org.springframework.cache.jcache.interceptor.BeanFactoryJCacheOperationSourceAdvisor">
<property name="cacheOperationSource" ref="annotationSource"/>
<property name="adviceBeanName" value="cacheInterceptor"/>
</bean>
<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
<property name="caches">
<set>
<ref bean="defaultCache"/>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
<property name="name" value="primary"/>
</bean>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
<property name="name" value="secondary"/>
</bean>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
<property name="name" value="exception"/>
</bean>
</set>
</property>
</bean>
<bean id="defaultCache"
class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
<property name="name" value="default"/>
</bean>
<bean id="cacheableService" class="org.springframework.cache.jcache.interceptor.AnnotatedJCacheableService">
<constructor-arg ref="defaultCache"/>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment