1 Reply Latest reply on Jan 20, 2012 5:41 PM by arulanandsp

    Over-riding the namedcache config using spring beans

    arulanandsp Newbie

      I am using infinispan 4.2.1

      Is there a way I can over-ride the named cache configuration using the spring beans?

       

      I have a named cache defined as below

       

      <namedCache name="defaultCache">

                <jmxStatistics enabled="true" />

                <clustering mode="local" />

                <eviction wakeUpInterval="5000" maxEntries="50000" strategy="LIRS"

                          threadPolicy="DEFAULT" />

                <expiration lifespan="-1" maxIdle="-1" />

      </namedCache>

       

       

      I would like to override the lifepan and the maxIdle property. Is it possible to do it using the spring wiring?

       

       

        • 1. Re: Over-riding the namedcache config using spring beans
          arulanandsp Newbie

          I was able to override using the below config

           

          <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">

              <property name="targetObject">

                            <bean factory-bean="dataCache" factory-method="getConfiguration" />

                 </property>

                 <property name="targetMethod" value="applyOverrides" />

                 <property name="arguments">

                                     <ref local="cacheConfiguration"/>

                 </property>

          </bean>