<?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-3.1.xsd"> <!--<bean name="localCacheStrategy" class="com.casic.accessControl.core.ext.cache.LocalCacheStrategy"/>--> <!--<bean name="remoteCacheStrategy" class="com.casic.accessControl.core.ext.cache.RemoteCacheStrategy"/>--> <cache:annotation-driven cache-manager="cacheManager"/> <!--定义缓存,这里的名称和方法名一致,便于理解--> <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> <property name="caches"> <set> <bean name="getAllPoint" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getMarkerByFeature" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getFeaturesByUser" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getChildrenByParentId" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getActiveChildrenOrgs" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getFeaturesByCompany" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getFeatureById" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getOrgList" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getTasks" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getTasksByPatroler" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getCompanies" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getRoles" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> <bean name="getRoleByType" class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean"/> </set> </property> </bean> </beans>