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>

  • 相关阅读:
    文件同步工具
    截图工具
    DBF文件工具
    Oracle旗下的开源虚拟机
    远程协助工具
    切换网络IP工具
    MySQL(C#的链接姿势)
    大写URL转小写
    一个textview实现文字在图片上面的效果
    通过代码设置textview颜色
  • 原文地址:https://www.cnblogs.com/man-li/p/4476201.html
Copyright © 2011-2022 走看看