Package org.jboss.cache.config

Examples of org.jboss.cache.config.EvictionPolicyConfig


      cacheNode = new Fqn(new Object[] { this.ejbContainer.getDeploymentQualifiedName() });

      // Try to create an eviction region per ejb
      region = cache.getRegion(cacheNode, true);
      EvictionPolicyConfig epc = getEvictionPolicyConfig((int) config.idleTimeoutSeconds(),
            config.maxSize());
      region.setEvictionPolicy(epc);

      // JBCACHE-1136.  There's no reason to have state in an inactive region
      cleanBeanRegion();
View Full Code Here


            && configuration.getEvictionConfig().isValidConfig())
      {
         // validate individual region configs now
         for (EvictionRegionConfig erc : configuration.getEvictionConfig().getEvictionRegionConfigs())
         {
            EvictionPolicyConfig epc = erc.getEvictionPolicyConfig();
            if (epc != null) epc.validate();
         }

         setEvictionConfig(configuration.getEvictionConfig());
         setUsingEvictions(true);
      }
View Full Code Here

   }

   public void testMaxNodes() throws Exception
   {
      log.info("set max nodes to 2, expire soonest to expire first");
      EvictionPolicyConfig epc = cache.getRegionManager().getAllRegions(Region.Type.EVICTION).get(0).getEvictionPolicyConfig();
      ExpirationConfiguration ec = (ExpirationConfiguration) epc;
      ec.setMaxNodes(2);
      Long future2 = future + 500;
      cache.put(fqn1, ExpirationConfiguration.EXPIRATION_KEY, future2);
      cache.put(fqn2, ExpirationConfiguration.EXPIRATION_KEY, future2);
View Full Code Here

      catch (Exception e)
      {
         throw new RuntimeException("Eviction class is not properly loaded in classloader", e);
      }

      EvictionPolicyConfig epc = null;
      try
      {
         epc = policy.getEvictionConfigurationClass().newInstance();
      }
      catch (RuntimeException e)
View Full Code Here

      this.setupCache("META-INF/conf-test/policyPerRegion-eviction-service.xml");
      assertEquals(5, cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds());

      Region region = regionManager.getRegion("/org/jboss/data", true);
      EvictionPolicy policy = region.getEvictionPolicy();
      EvictionPolicyConfig configuration = region.getEvictionPolicyConfig();
      assertEquals(Fqn.fromString("/org/jboss/data"), region.getFqn());
      assertTrue(policy instanceof LFUPolicy);
      assertTrue(configuration instanceof LFUConfiguration);
      assertEquals(5000, ((LFUConfiguration) configuration).getMaxNodes());
      assertEquals(1000, ((LFUConfiguration) configuration).getMinNodes());
View Full Code Here

      this.setupCache("META-INF/conf-test/mixedPolicy-eviction-service.xml");
      assertEquals(5, cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds());

      Region region = regionManager.getRegion("/org/jboss/data", true);
      EvictionPolicy policy = region.getEvictionPolicy();
      EvictionPolicyConfig configuration = region.getEvictionPolicyConfig();
      assertEquals(Fqn.fromString("/org/jboss/data/"), region.getFqn());
      assertTrue(policy instanceof FIFOPolicy);
      assertTrue(configuration instanceof FIFOConfiguration);
      assertEquals(5000, ((FIFOConfiguration) configuration).getMaxNodes());
View Full Code Here

      this.setupCache("META-INF/conf-test/local-lru-eviction-service.xml");
      assertEquals(5, cache.getConfiguration().getEvictionConfig().getWakeupIntervalSeconds());

      Region region = regionManager.getRegion("/org/jboss/data", false);
      EvictionPolicy policy = region.getEvictionPolicy();
      EvictionPolicyConfig configuration = region.getEvictionPolicyConfig();
      assertEquals(Fqn.fromString("/org/jboss/data/"), region.getFqn());
      assertTrue(policy instanceof LRUPolicy);
      assertTrue(configuration instanceof LRUConfiguration);
      assertEquals(5000, ((LRUConfiguration) configuration).getMaxNodes());
      assertEquals(1000, ((LRUConfiguration) configuration).getTimeToLiveSeconds());
View Full Code Here

            && configuration.getEvictionConfig().isValidConfig())
      {
         // validate individual region configs now
         for (EvictionRegionConfig erc : configuration.getEvictionConfig().getEvictionRegionConfigs())
         {
            EvictionPolicyConfig epc = erc.getEvictionPolicyConfig();
            if (epc != null) epc.validate();
         }

         setEvictionConfig(configuration.getEvictionConfig());
         setUsingEvictions(true);
      }
View Full Code Here

      cacheNode = new Fqn(new Object[] { SFSB, this.ejbContainer.getDeploymentPropertyListString() });
     
      // Try to create an eviction region per ejb
      region = cache.getRegion(cacheNode, true);
      EvictionPolicyConfig epc = getEvictionPolicyConfig();
      region.setEvictionPolicy(epc);

      if (cache.getCacheStatus() != CacheStatus.STARTED)
      {
         if (cache.getCacheStatus() != CacheStatus.CREATED)
View Full Code Here

      catch (Exception e)
      {
         throw new RuntimeException("Eviction class is not properly loaded in classloader", e);
      }

      EvictionPolicyConfig epc;
      try
      {
         epc = policy.getEvictionConfigurationClass().newInstance();
      }
      catch (RuntimeException e)
View Full Code Here

TOP

Related Classes of org.jboss.cache.config.EvictionPolicyConfig

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.