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

<!-- ===================================================================== -->
<!--                                                                       -->
<!--  Sample TreeCache Service Configuration                               -->
<!--                                                                       -->
<!-- ===================================================================== -->

<server>

    <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>


    <!-- ==================================================================== -->
    <!-- Defines TreeCache configuration                                      -->
    <!-- ==================================================================== -->

    <mbean code="org.jboss.cache.TreeCache"
        name="jboss.cache:service=TreeCache">

        <depends>jboss:service=Naming</depends>
        <depends>jboss:service=TransactionManager</depends>

        <!--
            Configure the TransactionManager
        -->
        <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>

        <attribute name="FetchInMemoryState">false</attribute>
        <attribute name="FetchPersistentState">false</attribute>
        <!--  Whether each interceptor should have an mbean
              registered to capture and display its statistics.  -->
        <attribute name="UseInterceptorMbeans">true</attribute>

        <!--
            Node locking scheme:
                OPTIMISTIC
                PESSIMISTIC (default)
        -->
        <attribute name="NodeLockingScheme">Optimistic</attribute>

        <!--
            Node locking level : SERIALIZABLE
                                 REPEATABLE_READ (default)
                                 READ_COMMITTED
                                 READ_UNCOMMITTED
                                 NONE
        -->
        <attribute name="IsolationLevel">READ_COMMITTED</attribute>


        <!--
             Valid modes are LOCAL
                             REPL_ASYNC
                             REPL_SYNC
        -->
        <attribute name="CacheMode">LOCAL</attribute>

        <!-- Name of cluster. Needs to be the same for all clusters, in order
             to find each other
        -->
        <attribute name="ClusterName">Infa-Cache-Cluster</attribute>

        <!-- Max number of milliseconds to wait for a lock acquisition -->
        <attribute name="LockAcquisitionTimeout">1000</attribute>

        <!-- Name of the eviction policy class.-->
        <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
        <attribute name="EvictionPolicyConfig">
            <config>
                <attribute name="wakeUpIntervalSeconds">1</attribute>
                <region name="/_default_">
                    <attribute name="maxNodes">10</attribute>
                    <attribute name="timeToLiveSeconds">0</attribute>
                    <attribute name="maxAgeSeconds">0</attribute>
                </region>
                <region name="/testingRegion">
                    <attribute name="maxNodes">10</attribute>
                    <attribute name="timeToLiveSeconds">0</attribute>
                    <attribute name="maxAgeSeconds">0</attribute>
                </region>
                <region name="/timeBased">
                    <attribute name="maxNodes">10</attribute>
                    <attribute name="timeToLiveSeconds">1</attribute>
                    <attribute name="maxAgeSeconds">1</attribute>
                </region>
            </config>
        </attribute>

    </mbean>
</server>
