Package org.jboss.cache.eviction

Examples of org.jboss.cache.eviction.LRUConfiguration


         removalTask = new RemovalTimeoutTask("SFSB Removal Thread - " + this.ejbContainer.getObjectName().getCanonicalName());
   }

   protected EvictionPolicyConfig getEvictionPolicyConfig(int timeToLiveSeconds, int maxNodes)
   {
      LRUConfiguration epc = new LRUConfiguration();
      // Override the standard policy class
      epc.setEvictionPolicyClass(AbortableLRUPolicy.class.getName());
      epc.setTimeToLiveSeconds(timeToLiveSeconds);
      epc.setMaxNodes(maxNodes);
      return epc;
   }
View Full Code Here


   public void setUp() throws Exception
   {
      super.setUp();
      regionManager = new RegionManager();
      LRUConfiguration config = new LRUConfiguration();
      regionManager.createRegion("/a/b/c", new DummyEvictionPolicy(), config);
      regionManager.createRegion("/a/b/d", new DummyEvictionPolicy(), config);
      regionManager.createRegion("/a/b", new DummyEvictionPolicy(), config);

      regionManager.createRegion("/d/e/f", new DummyEvictionPolicy(), config);
View Full Code Here

      ec.setDefaultEvictionPolicyClass(LRUPolicy.class.getName());
      ec.setWakeupIntervalSeconds(1000)// a long time; really disabled
      EvictionRegionConfig erc = new EvictionRegionConfig();
      erc.setRegionFqn(Fqn.ROOT);
      erc.setRegionName("_default_");
      LRUConfiguration epc = new LRUConfiguration();
      epc.setMaxNodes(1000);
      epc.setTimeToLiveSeconds(1000);
      erc.setEvictionPolicyConfig(epc);
      List<EvictionRegionConfig> ercs = new ArrayList<EvictionRegionConfig>();
      ercs.add(erc);
      ec.setEvictionRegionConfigs(ercs);
      config.setEvictionConfig(ec);
View Full Code Here

   {
      EvictionConfig evConfig = cache.getConfiguration().getEvictionConfig();
      EvictionRegionConfig evRegConfig = new EvictionRegionConfig();
      evRegConfig.setRegionFqn(Fqn.fromString("/" + TEST_NODES_ROOT));
      evRegConfig.setEventQueueSize(100);
      LRUConfiguration lruConfig = new LRUConfiguration();
      lruConfig.setMaxAgeSeconds(100000);
      lruConfig.setTimeToLiveSeconds(100000);
      lruConfig.setMaxNodes(3);
      evRegConfig.setEvictionPolicyConfig(lruConfig);
      evConfig.getEvictionRegionConfigs().add(evRegConfig);
      //end setting up region stuff
   }
View Full Code Here

public class LRUMinTTLTest extends MinTTLTestBase
{
   @Override
   protected EvictionPolicyConfigBase getEvictionPolicyConfig()
   {
      LRUConfiguration cfg = new LRUConfiguration();
      cfg.setTimeToLiveSeconds(1);
      return cfg;
   }
View Full Code Here

   {
      EvictionConfig ec = new EvictionConfig();
      ec.setWakeupIntervalSeconds(1);
      EvictionRegionConfig erc = new EvictionRegionConfig();
      erc.setRegionName("/_default_");
      LRUConfiguration epc = new LRUConfiguration();
      epc.setMaxAgeSeconds(2);
      epc.setTimeToLiveSeconds(1);
      epc.setMaxNodes(1);
      erc.setEvictionPolicyConfig(epc);
      List<EvictionRegionConfig> ercs = new ArrayList<EvictionRegionConfig>();
      ercs.add(erc);
      ec.setEvictionRegionConfigs(ercs);
      cfg.setEvictionConfig(ec);
View Full Code Here

      assertTrue(clusterCfg == null || clusterCfg.length() == 0);
     
      EvictionConfig ec = cfg.getEvictionConfig();
      assertEquals(LRUPolicy.class.getName(), ec.getDefaultEvictionPolicyClass());
      EvictionRegionConfig erc = ec.getEvictionRegionConfigs().get(0);
      LRUConfiguration epc = (LRUConfiguration) erc.getEvictionPolicyConfig();
      assertEquals(1000, epc.getMaxNodes());
     
      CacheLoaderConfig clc = cfg.getCacheLoaderConfig();
      IndividualCacheLoaderConfig iclc = clc.getFirstCacheLoaderConfig();
      assertEquals(System.getProperty("java.io.tmpdir"), iclc.getProperties().get("location"));
     
View Full Code Here

      List<EvictionRegionConfig> ercs = new ArrayList<EvictionRegionConfig>();

      EvictionRegionConfig erc = new EvictionRegionConfig();
      erc.setRegionFqn(RegionManager.DEFAULT_REGION);
      LRUConfiguration epc = new LRUConfiguration();
      epc.setMaxNodes(0);
      epc.setTimeToLiveSeconds(5);
      erc.setEvictionPolicyConfig(epc);
      ercs.add(erc);

      erc = new EvictionRegionConfig();
      erc.setRegionFqn(BASE);
      epc = new LRUConfiguration();
      epc.setMaxNodes(0);
      epc.setTimeToLiveSeconds(1);
      erc.setEvictionPolicyConfig(epc);
      ercs.add(erc);

      ec.setEvictionRegionConfigs(ercs);
View Full Code Here

   public static EvictionRegionConfig buildLruEvictionRegionConfig(String regionNaame, int maxNodes, int timeToLive)
   {
      EvictionRegionConfig erc = new EvictionRegionConfig();
      erc.setRegionName(regionNaame);
      LRUConfiguration lruConfig = new LRUConfiguration();
      lruConfig.setEvictionPolicyClass("org.jboss.cache.eviction.LRUPolicy");
      if (maxNodes >= 0) lruConfig.setMaxNodes(maxNodes);
      if  (timeToLive >= 0) lruConfig.setTimeToLiveSeconds(timeToLive);
      erc.setEvictionPolicyConfig(lruConfig);
      return erc;
   }
View Full Code Here

      ec.setDefaultEvictionPolicyClass(LRUPolicy.class.getName());
      ec.setWakeupIntervalSeconds(1000)// a long time; really disabled
      EvictionRegionConfig erc = new EvictionRegionConfig();
      erc.setRegionFqn(Fqn.ROOT);
      erc.setRegionName("_default_");
      LRUConfiguration epc = new LRUConfiguration();
      epc.setMaxNodes(1000);
      epc.setTimeToLiveSeconds(1000);
      erc.setEvictionPolicyConfig(epc);
      List<EvictionRegionConfig> ercs = new ArrayList<EvictionRegionConfig>();
      ercs.add(erc);
      ec.setEvictionRegionConfigs(ercs);
      config.setEvictionConfig(ec);
View Full Code Here

TOP

Related Classes of org.jboss.cache.eviction.LRUConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.