Package org.jboss.cache.eviction

Examples of org.jboss.cache.eviction.ExpirationAlgorithmConfig


      lru.setMaxAge(config.getMaxAgeInSeconds()*1000);
      lru.setTimeToLive(-1); // -1 no limit
      evictionConfig = lru;
    }
    else if (config.getPolicy() == Policy.EXPIRATION) {
      ExpirationAlgorithmConfig lfu  = new ExpirationAlgorithmConfig();
      lfu.setMaxNodes(config.getMaxEntries());
      evictionConfig = lfu;
    }
   
    EvictionRegionConfig erc = new EvictionRegionConfig(rootFqn, evictionConfig);
    erc.setEvictionActionPolicyClassName(RemoveOnEvictActionPolicy.class.getName());
View Full Code Here


   }

   public void start()
   {
      CacheFactory factory = new DefaultCacheFactory();
      ExpirationAlgorithmConfig exp = new ExpirationAlgorithmConfig();
      exp.setMaxNodes(maxSize);

      EvictionRegionConfig evictionRegionConfig = new EvictionRegionConfig(RegionManagerImpl.DEFAULT_REGION);
      evictionRegionConfig.setEvictionAlgorithmConfig(exp);

      EvictionConfig evictConfig = new EvictionConfig();
View Full Code Here

                }
            }
        } else {
            Configuration configuration = new Configuration();
            EvictionRegionConfig evictionRegionConfig = new EvictionRegionConfig(Fqn.root());
            ExpirationAlgorithmConfig expirationAlgorithm = new ExpirationAlgorithmConfig();
            int maxCacheSize = getIntConfigurationValue(facesContext, CoreConfiguration.Items.resourcesCacheSize);
            expirationAlgorithm.setMaxNodes(maxCacheSize);

            evictionRegionConfig.setEvictionAlgorithmConfig(expirationAlgorithm);

            EvictionConfig evictionConfig = new EvictionConfig(evictionRegionConfig);
View Full Code Here

    * Creates a new ExoCache instance with the relevant parameters
    */
   private ExoCache<Serializable, Object> create(ExoCacheConfig config, Cache<Serializable, Object> cache,
      int maxNodes, long minTimeToLive, long expirationTimeout) throws ExoCacheInitException
   {
      final ExpirationAlgorithmConfig ea = new ExpirationAlgorithmConfig();
      ea.setMaxNodes(maxNodes);
      ea.setMinTimeToLive(minTimeToLive);
      ea.setExpirationKeyName(ExpirationAlgorithmConfig.EXPIRATION_KEY);

      Fqn<String> rooFqn = addEvictionRegion(config, cache, ea);

      return new EAExoCache(config, cache, rooFqn, ea, expirationTimeout);
   }
View Full Code Here

    */
   private ExoCache<Serializable, Object> create(ExoCacheConfig config, Cache<Serializable, Object> cache,
      int maxNodes, long minTimeToLive, long expirationTimeout) throws ExoCacheInitException
   {
      final Configuration configuration = cache.getConfiguration();
      final ExpirationAlgorithmConfig ea = new ExpirationAlgorithmConfig();
      ea.setMaxNodes(maxNodes);
      ea.setMinTimeToLive(minTimeToLive);
      ea.setExpirationKeyName(ExpirationAlgorithmConfig.EXPIRATION_KEY);
      // Create an eviction region config
      final EvictionRegionConfig erc = new EvictionRegionConfig(Fqn.ROOT, ea);

      final EvictionConfig evictionConfig = configuration.getEvictionConfig();
      evictionConfig.setDefaultEvictionRegionConfig(erc);
View Full Code Here

TOP

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

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.