Package org.jboss.cache.eviction

Examples of org.jboss.cache.eviction.EvictionPolicy


         throw new IllegalArgumentException("null className");
      }
      try
      {
         if (log.isTraceEnabled()) log.trace("Instantiating " + className);
         EvictionPolicy ep = (EvictionPolicy) Util.loadClass(className).newInstance();
         ep.setCache(regionManager.getCache());
         return ep;
      }
      catch (Exception e)
      {
         log.fatal("Unable to instantiate eviction policy class " + className, e);
View Full Code Here


      if (log.isTraceEnabled())
      {
         log.trace("Attempting to evict cache node with fqn of " + fqn);
      }
     
      EvictionPolicy policy = region.getEvictionPolicy();
      try
      {
         policy.evict(fqn);
      }
      catch (ContextInUseException e)
      {
         // Don't log it at any alarming level
         if (log.isTraceEnabled())
View Full Code Here

      if (defaultEvictionPolicyClass != null)
      {
         try
         {
            Class<?> cpolicy = Class.forName(defaultEvictionPolicyClass);
            EvictionPolicy policy = (EvictionPolicy) cpolicy.newInstance();
            EvictionRegionConfig erc = new EvictionRegionConfig();
            EvictionPolicyConfig epc = policy.getEvictionConfigurationClass().newInstance();
            erc.setEvictionPolicyConfig(epc);
            erc.setRegionFqn(RegionManager.DEFAULT_REGION);
            return erc;
         }
         catch (Exception e)
View Full Code Here

            throw new MissingPolicyException(
                  "There is no Eviction Policy Class specified on the region or for the entire cache!");
         }
      }

      EvictionPolicy policy;
      try
      {
         policy = (EvictionPolicy) Util.loadClass(evictionClass).newInstance();
      }
      catch (RuntimeException e)
      {
         throw e;
      }
      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)
      {
         throw e;
      }
      catch (Exception e)
      {
         throw new RuntimeException("Failed to instantiate eviction configuration of class " +
               policy.getEvictionConfigurationClass(), e);
      }

      parseEvictionPolicyConfig(element, epc);

      erc.setEvictionPolicyConfig(epc);
View Full Code Here

      EvictionAlgorithm algorithm;

      try
      {
         EvictionPolicy ep = (EvictionPolicy) Util.getInstance(evictionClass);
         Class<? extends EvictionAlgorithm> algoClass = ((ModernizablePolicy) ep).modernizePolicy();
         if (log.isTraceEnabled()) log.trace("Using algo class " + algoClass);
         algorithm = Util.getInstance(algoClass);
      }
      catch (RuntimeException e)
View Full Code Here

/*  56 */     if (log.isTraceEnabled())
/*     */     {
/*  58 */       log.trace("Attempting to evict cache node with fqn of " + fqn);
/*     */     }
/*     */
/*  61 */     EvictionPolicy policy = this.region.getEvictionPolicy();
/*     */     try
/*     */     {
/*  64 */       policy.evict(fqn);
/*     */     }
/*     */     catch (ContextInUseException e)
/*     */     {
/*  69 */       if (log.isTraceEnabled())
/*  70 */         log.trace("Eviction of " + fqn + " aborted as bean is in use");
View Full Code Here

TOP

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

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.