0

I have this xml configuration

<config
        xmlns='http://www.ehcache.org/v3'
        xmlns:jsr107='http://www.ehcache.org/v3/jsr107'>

    <service>
        <jsr107:defaults enable-statistics="true"/>
    </service>

    <cache alias="productsCache">
        <key-type>java.lang.Long</key-type>
        <value-type>com.draeger.hca.domain.product.Product</value-type>
        <expiry>
            <ttl unit="seconds">10</ttl>
        </expiry>
        <listeners>
            <listener>
                <class>com.draeger.hca.infrastructure.ehcache.CacheLogger</class>
                <event-firing-mode>ASYNCHRONOUS</event-firing-mode>
                <event-ordering-mode>UNORDERED</event-ordering-mode>

                <events-to-fire-on>CREATED</events-to-fire-on>
                <events-to-fire-on>UPDATED</events-to-fire-on>
                <events-to-fire-on>EXPIRED</events-to-fire-on>
                <events-to-fire-on>REMOVED</events-to-fire-on>
                <events-to-fire-on>EVICTED</events-to-fire-on>
            </listener>
        </listeners>
        <resources>
            <heap unit="entries">2</heap>
        </resources>
    </cache>
</config>

I was wondering, is there any way to specify eviction policy (LFU to be specific) using xml file? I really want to avoid doing it programatically.

Progman
  • 16,827
  • 6
  • 33
  • 48

0 Answers0