Examples of addEvictionRegionConfig()


Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

   void initCaches() throws Exception
   {
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      EvictionConfig evConfig = new EvictionConfig(new EvictionRegionConfig(Fqn.ROOT, new ElementSizeAlgorithmConfig(5000, 100), 200000), 200);
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/data"), new ElementSizeAlgorithmConfig(10, 20)));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/test/data"), new ElementSizeAlgorithmConfig(-1, 5)));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/test/"), new ElementSizeAlgorithmConfig(5000, 1)));
      conf.setEvictionConfig(evConfig);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(conf, false);
      cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

   void initCaches() throws Exception
   {
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      EvictionConfig evConfig = new EvictionConfig(new EvictionRegionConfig(Fqn.ROOT, new ElementSizeAlgorithmConfig(5000, 100), 200000), 200);
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/data"), new ElementSizeAlgorithmConfig(10, 20)));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/test/data"), new ElementSizeAlgorithmConfig(-1, 5)));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/test/"), new ElementSizeAlgorithmConfig(5000, 1)));
      conf.setEvictionConfig(evConfig);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(conf, false);
      cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

   {
      Configuration conf = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      EvictionConfig evConfig = new EvictionConfig(new EvictionRegionConfig(Fqn.ROOT, new ElementSizeAlgorithmConfig(5000, 100), 200000), 200);
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/data"), new ElementSizeAlgorithmConfig(10, 20)));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/test/data"), new ElementSizeAlgorithmConfig(-1, 5)));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/test/"), new ElementSizeAlgorithmConfig(5000, 1)));
      conf.setEvictionConfig(evConfig);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(conf, false);
      cache.getConfiguration().setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      cache.getConfiguration().setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache.start();
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

    */
   public void testEviction() throws InterruptedException
   {
      Configuration config = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      EvictionConfig evConfig = new EvictionConfig(new EvictionRegionConfig(Fqn.ROOT, new NullEvictionAlgorithmConfig(), 200000), 200);
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/test"), new NullEvictionAlgorithmConfig()));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/lru"), new LRUAlgorithmConfig(1000, 10000)));
      config.setEvictionConfig(evConfig);
      config.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      config.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(config);
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

   public void testEviction() throws InterruptedException
   {
      Configuration config = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
      EvictionConfig evConfig = new EvictionConfig(new EvictionRegionConfig(Fqn.ROOT, new NullEvictionAlgorithmConfig(), 200000), 200);
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/test"), new NullEvictionAlgorithmConfig()));
      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/lru"), new LRUAlgorithmConfig(1000, 10000)));
      config.setEvictionConfig(evConfig);
      config.setTransactionManagerLookupClass(DummyTransactionManagerLookup.class.getName());
      config.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(config);
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

      LRUAlgorithmConfig lruConfig = new LRUAlgorithmConfig();
      lruConfig.setMaxAge(100000000);
      lruConfig.setTimeToLive(100000000);
      lruConfig.setMaxNodes(3);
      evRegConfig.setEvictionAlgorithmConfig(lruConfig);
      evConfig.addEvictionRegionConfig(evRegConfig);
      //end setting up region stuff
   }

   @AfterMethod(alwaysRun = true)
   public void tearDown() throws Exception
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

      erc.setRegionFqn(Fqn.ROOT);
      LRUAlgorithmConfig lruAlgorithmConfig = new LRUAlgorithmConfig();
      lruAlgorithmConfig.setMaxNodes(1000);
      lruAlgorithmConfig.setTimeToLive(1000000);
      erc.setEvictionAlgorithmConfig(lruAlgorithmConfig);
      ec.addEvictionRegionConfig(erc);
      config.setEvictionConfig(ec);

      CacheLoaderConfig clc = new CacheLoaderConfig();
      clc.setPassivation(true);
      clc.setShared(false);
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

      erc.setRegionFqn(Fqn.ROOT);
      LRUAlgorithmConfig lruAlgorithmConfig = new LRUAlgorithmConfig();
      lruAlgorithmConfig.setMaxNodes(1000);
      lruAlgorithmConfig.setTimeToLive(1000000);
      erc.setEvictionAlgorithmConfig(lruAlgorithmConfig);
      ec.addEvictionRegionConfig(erc);
      config.setEvictionConfig(ec);

      CacheLoaderConfig clc = new CacheLoaderConfig();
      clc.setPassivation(true);
      clc.setShared(false);
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

      region2.setRegionFqn(base);
      LRUAlgorithmConfig epc2 = new LRUAlgorithmConfig();
      epc2.setMaxNodes(100);
      epc2.setTimeToLive(3000);
      region2.setEvictionAlgorithmConfig(epc2);
      cfg.addEvictionRegionConfig(region2);

      return cfg;
   }

   @AfterMethod(alwaysRun = true)
View Full Code Here

Examples of org.jboss.cache.config.EvictionConfig.addEvictionRegionConfig()

      ec.setDefaultEvictionRegionConfig(new EvictionRegionConfig(Fqn.ROOT, lru));

      lru = new LRUAlgorithmConfig();
      lru.setMaxNodes(0);
      lru.setTimeToLive(1000);
      ec.addEvictionRegionConfig(new EvictionRegionConfig(BASE, lru));

      cache.getConfiguration().setEvictionConfig(ec);
   }

   @AfterMethod(alwaysRun = true)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.