applicationContext-ehcache.xml 1019 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?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
          http://www.springframework.org/schema/beans/spring-beans.xsd
		  http://www.springframework.org/schema/cache
          http://www.springframework.org/schema/cache/spring-cache.xsd">

	<!-- 支持缓存注解 -->
	<cache:annotation-driven cache-manager="cacheManager" />

	<!-- 默认是cacheManager -->
	<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
		<property name="cacheManager"  ref="cacheManagerFactory"/>
	</bean>

	<!-- cache管理器配置 -->
	<bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
		<property name="configLocation"  value="classpath:ehcache.xml"/>
		<property name="shared" value="true" />
	</bean>

</beans>