org.jboss.cache.eviction
Class FIFOAlgorithm

java.lang.Object
  extended by org.jboss.cache.eviction.BaseEvictionAlgorithm
      extended by org.jboss.cache.eviction.FIFOAlgorithm
All Implemented Interfaces:
EvictionAlgorithm

public class FIFOAlgorithm
extends BaseEvictionAlgorithm

First-in-first-out algorithm used to evict nodes.

Version:
$Revision: 1.5 $
Author:
Daniel Huang - dhuang@jboss.org, Morten Kvistgaard

Field Summary
 
Fields inherited from class org.jboss.cache.eviction.BaseEvictionAlgorithm
evictionQueue, recycleQueue, region
 
Constructor Summary
FIFOAlgorithm()
           
 
Method Summary
protected  EvictionQueue setupEvictionQueue(Region region)
          This method will create an EvictionQueue implementation and prepare it for use.
protected  boolean shouldEvictNode(NodeEntry ne)
          For FIFO, a node should be evicted if the queue size is >= to the configured maxNodes size.
 
Methods inherited from class org.jboss.cache.eviction.BaseEvictionAlgorithm
emptyRecycleQueue, evict, evictCacheNode, getEvictionQueue, initialize, isNodeInUseAndNotTimedOut, process, processAddedElement, processAddedNodes, processMarkInUseNodes, processQueues, processRemovedElement, processRemovedNodes, processUnmarkInUseNodes, processVisitedNodes, prune, resetEvictionQueue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIFOAlgorithm

public FIFOAlgorithm()
Method Detail

setupEvictionQueue

protected EvictionQueue setupEvictionQueue(Region region)
                                    throws EvictionException
Description copied from class: BaseEvictionAlgorithm
This method will create an EvictionQueue implementation and prepare it for use.

Specified by:
setupEvictionQueue in class BaseEvictionAlgorithm
Parameters:
region - Region to setup an eviction queue for.
Returns:
The created EvictionQueue to be used as the eviction queue for this algorithm.
Throws:
EvictionException
See Also:
EvictionQueue

shouldEvictNode

protected boolean shouldEvictNode(NodeEntry ne)
For FIFO, a node should be evicted if the queue size is >= to the configured maxNodes size.

Specified by:
shouldEvictNode in class BaseEvictionAlgorithm
Parameters:
ne - NodeEntry to test eviction for.
Returns:
True if the given node should be evicted. False if the given node should not be evicted.


Copyright 1998-2005 JBoss Inc . All Rights Reserved.