<?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">
|
<!-- Spring提供的基于的Ehcache实现的缓存管理器 -->
|
|
<!-- 如果有多个ehcacheManager要在bean加上p:shared="true" -->
|
|
<bean id="cacheManager1" class="org.springframework.cache.ehcache.EhCacheCacheManager">
|
<property name="cacheManager" ref="ehcacheManager"/>
|
<property name="transactionAware" value="true"/>
|
</bean>
|
|
<!-- cache注解,和spring-redis.xml中的只能使用一个 -->
|
<cache:annotation-driven cache-manager="cacheManager1" proxy-target-class="true"/>
|
</beans>
|