4 Replies Latest reply on Aug 4, 2008 4:35 PM by Manik Surtani

    Eviction Policy Config not working

    lords_diakonos Newbie

      Using the following xml config I have objects in the FQN "ContentletCache" greater then 2. I am trying to get it to respect the maxNodes.

      <attribute name="EvictionPolicyConfig">
       <config>
       <attribute name="wakeUpIntervalSeconds">3</attribute>
       <!-- This defaults to 200000 if not specified -->
       <attribute name="eventQueueSize">500000</attribute>
       <!-- Name of the DEFAULT eviction policy class. -->
       <attribute name="policyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
       <!-- Cache wide default -->
       <region name="/_default_">
       <attribute name="maxNodes">10000</attribute>
       <attribute name="timeToLiveSeconds">864000</attribute>
       </region>
      
       <!-- contentlet cache -->
       <region name="/ContentletCache">
       <attribute name="maxNodes">2</attribute>
       <attribute name="minTimeToLiveSeconds">0</attribute>
       <attribute name="timeToLiveSeconds">0</attribute>
       <attribute name="maxAgeSeconds">0</attribute>
       </region>
       </config>
       </attribute>
      


      My java logic is is as following

      public DotJBCacheAdministratorImpl() {
       CacheFactory<String, Object> factory = new DefaultCacheFactory<String, Object>();
       cache = factory.createCache("cache-configuration.xml");
       //cache.getRegion(Fqn.fromString(CacheLocator.getContentletCache().getPrimaryGroup()), true);
       }
      

      cache.put("ContentletCache",key,object);
      
      


      return cache.get("return cache.get(group, key);", key);