[jboss-cvs] JBossCache/src/org/jboss/cache/pojo/eviction ...
Ben Wang
bwang at jboss.com
Sat Jan 13 10:55:08 EST 2007
User: bwang
Date: 07/01/13 10:55:08
Added: src/org/jboss/cache/pojo/eviction AopLRUAlgorithm.java
AopLRUPolicy.java AopEvictionPolicy.java
Log:
JBCACHE-922 Merged src-50 and tests-50 into src and tests, respectively.
Revision Changes Path
1.1 date: 2007/01/13 15:55:08; author: bwang; state: Exp;JBossCache/src/org/jboss/cache/pojo/eviction/AopLRUAlgorithm.java
Index: AopLRUAlgorithm.java
===================================================================
package org.jboss.cache.pojo.eviction;
import org.jboss.cache.eviction.LRUAlgorithm;
/**
* 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 PojoReference 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
*/
class AopLRUAlgorithm extends LRUAlgorithm
{
}
1.1 date: 2007/01/13 15:55:08; author: bwang; state: Exp;JBossCache/src/org/jboss/cache/pojo/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.pojo.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.Fqn;
import org.jboss.cache.eviction.EvictionAlgorithm;
import org.jboss.cache.eviction.LRUPolicy;
import org.jboss.cache.eviction.NodeEventType;
/**
* 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
*/
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: 2007/01/13 15:55:08; author: bwang; state: Exp;JBossCache/src/org/jboss/cache/pojo/eviction/AopEvictionPolicy.java
Index: AopEvictionPolicy.java
===================================================================
package org.jboss.cache.pojo.eviction;
/**
* Just a maker interface for PojoCache-specific eviction algorithm.
*/
public interface AopEvictionPolicy
{
}
More information about the jboss-cvs-commits
mailing list