缓存的切换

缓存的切换:

切换缓存只要改变id为cacheManager对应的类(缓存管理器)

<cache:annotation-driven />

<!-- 

设置缓存超时时间

<property name="expires">

<map>

                <entry key="findByAreaLevel" value="100" />

                <entry key="BasLkpDao_findByBusinessType" value="10" />

            </map>

</property>

-->

<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:use-pool="true" p:hostName="10.0.1.224" p:port="6379" />

<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate" p:connection-factory-ref="jedisConnectionFactory" />

<bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager" c:redisOperations-ref="redisTemplate"  />

<!--

<bean id="cacheManager" class="org.springframework.cache.concurrent.ConcurrentMapCacheManager" /> 

-->

猜你喜欢

转载自yuhuiblog6338999322098842.iteye.com/blog/2314890
今日推荐