`
ssxxjjii
  • 浏览: 935706 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

ehcache.xml例子

阅读更多

<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"
                updateCheck="true" monitoring="autodetect" dynamicConfig="true">
       
        <diskStore path="java.io.tmpdir/ehcache-wisdom" />
       
        <!-- 设置自身 -->
       
    <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"  
       properties="hostName=127.0.0.1,port=40001,socketTimeoutMillis=2000" />
       
       
        <!-- |//192.168.1.其他集群服务器IP:40002/security_resource"/> -->
       
        <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
                      properties="peerDiscovery=manual,
                      rmiUrls=//127.0.0.1:40002/security_resource"/>
                     
       
        <!-- <defaultCache maxElementsInMemory="内存对象数量" overflowToDisk="内存满后是否存磁盘" eternal="对象永不过期"
                memoryStoreEvictionPolicy="LRU优先清除不经常使用的对象" maxElementsOnDisk="磁盘对象数量" diskExpiryThreadIntervalSeconds="访问磁盘线程活动时间"
                timeToIdleSeconds="清理多少秒不使用的对象" timeToLiveSeconds="清理创建多少秒的对象" diskPersistent="重启内存对象持久化入磁盘" /> -->
       
        <defaultCache maxElementsInMemory="10000" overflowToDisk="true" eternal="false"
                memoryStoreEvictionPolicy="LRU" maxElementsOnDisk="10000000" diskExpiryThreadIntervalSeconds="600"
                timeToIdleSeconds="3600" timeToLiveSeconds="100000" diskPersistent="false">
                <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" />    
        </defaultCache>
       
       
        <!-- replicateAsynchronously对象同步是否异步完成,默认为true。如果比较紧急就设为false。
                                                                在一致性时间性要求不强的时候,设为异步可大大提供性能,因为它是异步立即返回的,而且可以批量提交。
                replicateUpdatesViaCopy 是否将对象变更复制到所有节点,还是只是发送一个失效信息,让对方该缓存失效,当对方需要该缓存时重新计算载入。
                                                                默认为true。鉴于对象复制的消耗挺大的,又有锁的问题,而且对方也未必需要该对象,所以此属性建议设为false。
                                                                如果业务上真的需要设为true时,就可考虑使用Terracotta了。
                replicatePuts、replicateUpdates、replicateRemovals增删改是否同步,默认都为true。但因为我们前面选择了失效算法,
                                        所以replicatePuts要设为false。 -->

        <cache name="security_resource" maxElementsInMemory="500" eternal="true" overflowToDisk="true">  
        <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
        properties="replicateAsynchronously=true,replicateUpdatesViaCopy=false,
                                replicatePuts=false,replicateUpdates=false,replicateRemovals=false"/>  
    </cache>

        <cache name="task_scheduled" maxElementsInMemory="50" eternal="true" overflowToDisk="true"/>  

        <cache name="logger_cache" maxElementsInMemory="1000" eternal="true" overflowToDisk="true"/>  

        <cache name="jdbc_cache" maxElementsInMemory="1000" eternal="true" overflowToDisk="true"/>  

        <cache name="online_user_cache" maxElementsInMemory="200" eternal="true" overflowToDisk="true"/>  
       
</ehcache>

分享到:
评论
1 楼 cuckoobird99 2011-09-02  
请问你这个ehcache 的版本号是多少,我配置有错啊

相关推荐

    ehcache.xsd_ehcache.xml代码提示.rar

    软件介绍: 已测试有效的ehcache.xsd文件,引入ide中,进行ehcache.xml的代码提示。Windows外壳公用DLL文件,大小23.1KB。

    ehcache.xml 文件

    ehcache.xml 文件

    ehcache.xml

    ehcache.xml

    shiro-ehcache.xml

    在maven项目中,此shiro-ehcache.xml配置文件放在resources下,在applicationContext.xml中,用于shiro缓存管理器所配置,然后给shiro安全管理器配置此缓存管理器

    ehcache的配置参数详解

    hibernate ehcache.xml 配置详解

    ehcache.xsd文件

    用于引入ide中,进行ehcache.xml的代码提示。本人已亲测有效。

    mybatis ehcache 1.0 ehcache.xsd 提示文件

    mybatis 第三方二级缓存,ehcache 配置文件的 约束文件 ehcache.xsd !!

    借助Ehcache缓存框架实现对页面的缓存Demo

    1、ehcache.xml和ehcache.xsd两个文件可以在下在下载下来的名为“ehcache-core-x.x.x-distribution.tar.gz”压缩文件中找到 2、由于要实现Ehcache缓存页面,所以必须要添加“ehcache-web-2.0.4.jar” jar包,该jar包...

    ehcache-core-2.6.5.jar和mybatis-ehcache-1.0.2.jar

    ehcache.xml配置内容 &lt;ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ehcache.org/ehcache.xsd"&gt; &lt;diskStore path="java.io.tmpdir"/&gt; eternal=...

    java web项目里ehcache.xml介绍

    java web项目里ehcache.xml介绍,需要的朋友可以参考一下

    ehcache.xsd

    在springboot上配置ehcache时用到的xld文件,在编写xml时会报找不到ehcache.xsd文件,把这个文件放到resources目录底下即可

    ehcahe页面缓存详细内容

    2.将ehcache.xml放入能加载到classpath中的任意包中,不能放入WEB-INF中(其详细配置参数代表含义已经注释) 3.在工程中web.xml配置过滤器 &lt;filter-name&gt;SimplePageCachingFilter &lt;filter-class&gt;...

    ehcache.jar

    ehcache.jar 用于缓存机制的加入。ehcache.jar 用于缓存机制的加入。

    springmodules-cache.xsd&springmodules-ehcache.xsd.rar

    解决web.xml中 &lt;page-encoding&gt;UTF-8报错。错误提示: cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. One of '{"http:// java.sun....

    Java缓存框架 Ehcache.zip

    EhCache 是一个纯Java的进程内缓存框架,具有快速、精干等特点,是Hibernate中默认的CacheProvider。 下图是 Ehcache 在应用程序中的位置: 主要的特性有: 1. 快速.2. 简单.3. 多种缓存策略4. 缓存数据有两级:...

    ehcache-2.10.5.zip

    ehcache.xml 和 ehcache.xsd 版本是 2.10.5 在ehcache.xml 与 ehcache.xsd 放在同一目录下 配置如下 &lt;ehcache xmlns:xsi=...

    Hibernate_EHcache.doc

    Hibernate_EHcache.docHibernate_EHcache.doc

    ehcache.jar(含源码)

    EhCache 是一个纯Java的进程内缓存框架,具有快速、精干等特点,是Hibernate中默认的CacheProvider。 Ehcache是一种广泛使用的开源Java分布式缓存。主要面向通用缓存,Java EE和轻量级容器。它具有内存和磁盘存储,...

    ehcache.jar 缓存jar

    ehcache.jar 缓存jar

Global site tag (gtag.js) - Google Analytics