Welcome 微信登录

首页 / 软件开发 / JAVA / Ehcache缓存框架

Ehcache缓存框架2011-10-22 z7swf 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>