1 7 package org.jboss.cache.eviction; 8 9 import org.jboss.cache.Fqn; 10 import org.jboss.cache.Region; 11 12 23 public class MRUAlgorithm extends BaseEvictionAlgorithm 24 { 25 protected EvictionQueue setupEvictionQueue(Region region) throws EvictionException 26 { 27 return new MRUQueue(); 28 } 29 30 protected boolean shouldEvictNode(NodeEntry ne) 31 { 32 MRUConfiguration config = (MRUConfiguration) region.getEvictionPolicyConfig(); 33 return evictionQueue.getNumberOfNodes() > config.getMaxNodes(); 34 } 35 36 protected void processVisitedNodes(Fqn fqn) throws EvictionException 37 { 38 super.processVisitedNodes(fqn); 39 ((MRUQueue) evictionQueue).moveToTopOfStack(fqn); 40 } 41 } 42 | Popular Tags |