WEB开发网
开发学院软件开发Java Ehcache缓存框架 阅读

Ehcache缓存框架

 2010-03-22 00:00:00 来源:WEB开发网   
核心提示:Kernel: ehcache.jarXml:ehcache.xmlXml代码 <ehcachexmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="ehcache.xs

Kernel: ehcache.jar

Xml:ehcache.xml

Xml代码

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"> 
 <diskStore path="c:\\temp" /> 
 <cacheManagerEventListenerFactory class="" properties="" /> 
 
 <!-- 
 Uncomment the following in a clustered configuration. 
 --> 
 
 <!--<cacheManagerPeerProviderFactory 
 class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory" 
 properties="peerDiscovery=automatic,multicastGroupAddress=230.0.0.1,multicastGroupPort=4446,timeToLive=1" 
 propertySeparator="," 
 /> 
 <cacheManagerPeerListenerFactory 
 class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" 
 />--> 
 
 <!-- 
 Hibernate will use the defaultCache unless custom configurations are defined 
 below for individual domain objects, collection, queries, etc. 
 --> 
 
 <defaultCache 
 maxElementsInMemory="10000" 
 eternal="false" 
    timeToIdleSeconds="600" 
 overflowToDisk="true" 
 > 
 <!--<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" /> 
 <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" />--> 
 </defaultCache> 
 
 <!-- 
 The cache name is the same as the class name specified in your Hibernate 
 mapping file. 
 --> 
 
 <cache 
 name="sampleCache" 
 maxElementsInMemory="5" 
 maxElementsOnDisk="100" 
 eternal="false" 
    timeToIdleSeconds="2" 
    timeToLiveSeconds="2" 
 overflowToDisk="true" 
 > 
 <!--<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" /> 
 <bootstrapCacheLoaderFactory class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory" />--> 
 </cache> 
</ehcache>

1 2 3  下一页

Tags:Ehcache 缓存 框架

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接