zoukankan      html  css  js  c++  java
  • spring cache

    spring-ehcache.xml文件内容如下:

    <?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:context="http://www.springframework.org/schema/context"
    xmlns:cache="http://www.springframework.org/schema/cache"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/cache
    http://www.springframework.org/schema/cache/spring-cache-4.0.xsd">

    <cache:annotation-driven cache-manager="cacheManager"/>

    <bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="configLocation" value="classpath:ehcache.xml" />
    </bean>

    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
    <property name="cacheManager" ref="cacheManagerFactory"/>
    </bean>

    </beans>

    ehcache.xml文件内容如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">


    <!-- 默认缓存 -->
    <defaultCache
    maxElementsInMemory="7000"
    eternal="false"
    timeToIdleSeconds="120"
    timeToLiveSeconds="120"
    overflowToDisk="false"/>

    <!-- 交易数据缓存 FIFO 先进先策略-->
    <cache name="tradeDataCache"
    maxElementsInMemory="7000"
    eternal="false"
    timeToIdleSeconds="120"
    timeToLiveSeconds="120"
    overflowToDisk="false"
    memoryStoreEvictionPolicy="FIFO"/>
    </ehcache>

  • 相关阅读:
    vue的nuxt框架中使用vue-video-player
    多线程学习笔记-1
    Java模拟简单的KFC程序
    Hankson最大公约数最小公倍数的“逆问题”
    C语言实现三天打鱼两天晒网
    关于border-color的一些小问题
    CSS的超链接样式设计
    CSS ID选择器&通配选择器
    CSS标签选择器&类选择器
    CSS布局属性
  • 原文地址:https://www.cnblogs.com/man-li/p/4476201.html
Copyright © 2011-2022 走看看