ehcache 3 配置文件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zdc524/article/details/70842490

ehcache 3 配置文件
很多元素 需要 按顺序配置
这里写图片描述

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.ehcache.org/v3' xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core.xsd">

    <persistence directory="ehcacheTestDisk" />
    <thread-pools>
        <thread-pool alias="defaultDiskPool" min-size="1" max-size="3" />
        <thread-pool alias="defaultWriteBehindPool" min-size="1" max-size="3" />
        <thread-pool alias="cache2Pool" min-size="2" max-size="2" />
    </thread-pools>

    <event-dispatch thread-pool="defaultDiskPool" />
    <write-behind thread-pool="defaultWriteBehindPool" />
    <disk-store thread-pool="defaultDiskPool" />

    <cache alias="foo">
        <key-type>java.lang.Long</key-type>
        <value-type>java.lang.String</value-type>
        <resources>
            <heap unit="entries">2000</heap>
            <offheap unit="MB">500</offheap>
            <disk persistent="true" unit="MB">640</disk>
        </resources>
    </cache>
    <!--缓存配置 -->
    <cache-template name="myDefaults">
        <key-type>java.lang.Long</key-type>
        <value-type>java.lang.String</value-type>
        <heap unit="entries">200</heap>

    </cache-template>

    <cache alias="bar" uses-template="myDefaults">

    </cache>

    <cache alias="simpleCache" uses-template="myDefaults" />





</config>


更多精彩内容