jCacheNamespaceDriven.xml 1.6 KB
Newer Older
1 2 3 4 5
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:cache="http://www.springframework.org/schema/cache"
	   xsi:schemaLocation="http://www.springframework.org/schema/beans
S
Spring Operator 已提交
6
	   		https://www.springframework.org/schema/beans/spring-beans.xsd
7
       		http://www.springframework.org/schema/cache
S
Spring Operator 已提交
8
       		https://www.springframework.org/schema/cache/spring-cache.xsd">
9

10
	<cache:annotation-driven proxy-target-class="false" order="0" error-handler="errorHandler"/>
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

	<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>

29 30
	<bean id="errorHandler" class="org.springframework.cache.interceptor.SimpleCacheErrorHandler"/>

31 32 33 34 35 36 37 38 39 40
	<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>