[jboss-cvs] JBossCache/old/src/org/jboss/cache/aop/eviction ...

Ben Wang bwang at jboss.com
Tue Oct 31 03:01:15 EST 2006


  User: bwang   
  Date: 06/10/31 03:01:15

  Added:       old/src/org/jboss/cache/aop/eviction    AopLRUPolicy.java
                        AopLRUAlgorithm.java AopEvictionPolicy.java
  Log:
  Deprecated files moved to old dir.
  
  Revision  Changes    Path
  1.1      date: 2006/10/31 08:01:15;  author: bwang;  state: Exp;JBossCache/old/src/org/jboss/cache/aop/eviction/AopLRUPolicy.java
  
  Index: AopLRUPolicy.java
  ===================================================================
  /*
   * JBoss, the OpenSource J2EE webOS
   *
   * Distributable under LGPL license.
   * See terms of license at gnu.org.
   * Created on March 25 2003
   */
  package org.jboss.cache.aop.eviction;
  
  //import org.apache.commons.logging.Log;
  //import org.apache.commons.logging.LogFactory;
  //import org.jboss.cache.aop.eviction.AopEvictionPolicy;
  //import org.jboss.cache.aop.eviction.AopLRUAlgorithm;
  import org.jboss.cache.eviction.LRUPolicy;
  import org.jboss.cache.eviction.EvictionAlgorithm;
  import org.jboss.cache.eviction.NodeEventType;
  import org.jboss.cache.Fqn;
  import org.jboss.cache.aop.InternalDelegate;
  
  
  /**
   * Provider to provide eviction policy. This one is based on LRU algorithm that a user
   * can specify either maximum number of nodes or the idle time of a node to be evicted.
   *
   * @author Ben Wang 02-2004
   */
  public class AopLRUPolicy extends LRUPolicy implements AopEvictionPolicy
  {
  //   private static final Log log_ = LogFactory.getLog(AopLRUPolicy.class);
  
     public AopLRUPolicy()
     {
        super();
        algorithm = (EvictionAlgorithm)new AopLRUAlgorithm();
     }
  
     // we are using the same eviction algorithm now.
     public EvictionAlgorithm getEvictionAlgorithm()
     {
        return algorithm;
     }
  
     /**
      * Override to provide PojoCache specific behavior.
      * @param fqn
      */
     public boolean canIgnoreEvent(Fqn fqn, NodeEventType eventType) {
        return false;
     }
  }
  
  
  
  1.1      date: 2006/10/31 08:01:15;  author: bwang;  state: Exp;JBossCache/old/src/org/jboss/cache/aop/eviction/AopLRUAlgorithm.java
  
  Index: AopLRUAlgorithm.java
  ===================================================================
  package org.jboss.cache.aop.eviction;
  
  import org.jboss.cache.Fqn;
  import org.jboss.cache.eviction.LRUAlgorithm;
  import org.jboss.cache.eviction.EvictionPolicy;
  import org.jboss.cache.eviction.EvictionException;
  import org.jboss.cache.eviction.NodeEntry;
  import org.jboss.cache.aop.AOPInstance;
  
  import java.util.Iterator;
  import java.util.Set;
  
  /**
   * LRUAlgorithm specific to PojoCache. Overriding couple of hooks to customize
   * the algorithm such that it works correctly when using PojoCache.
   * The basic strategy for the AOP-specific case are:
   * <ul>
   * <li>When a node is visited, it will check if it is an AOPInstance node. If it
   * is, then it is an AOP node. In that case, we will update all children nodes'
   * time stamp to synchronize with parent node.</li>
   * <li>When a node is to be evicted, it will check if it an AOP node. If it is,
   * we will traverse through the children nodes to see if their timestamp is younger.
   * If it is younger, then we must not evict the whol aop node (i.e., parent node is
   * not evicted either). Furthermore, we should synchronize the whole tree.
   * </ul>
   *
   * @author Ben Wang, Feb 17, 2004
   */
  public class AopLRUAlgorithm extends LRUAlgorithm
  {
  }
  
  
  
  1.1      date: 2006/10/31 08:01:15;  author: bwang;  state: Exp;JBossCache/old/src/org/jboss/cache/aop/eviction/AopEvictionPolicy.java
  
  Index: AopEvictionPolicy.java
  ===================================================================
  package org.jboss.cache.aop.eviction;
  
  /**
   * Just a maker interface for PojoCache-specific eviction algorithm.
   */
  public interface AopEvictionPolicy
  {
  }
  
  
  



More information about the jboss-cvs-commits mailing list