org.jboss.cache.eviction
Class FIFOAlgorithm
java.lang.Object
org.jboss.cache.eviction.BaseEvictionAlgorithm
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: 7168 $
- Author:
- Daniel Huang - dhuang@jboss.org, Morten Kvistgaard
Methods inherited from class org.jboss.cache.eviction.BaseEvictionAlgorithm |
assignToRegion, canIgnoreEvent, emptyRecycleQueue, evict, evictCacheNode, getEvictionActionPolicy, getEvictionAlgorithmConfig, getEvictionQueue, getNextInQueue, initialize, isNodeInUseAndNotTimedOut, isYoungerThanMinimumTimeToLive, process, processAddedElement, processAddedNodes, processAddedNodes, processMarkInUseNodes, processQueues, processRemovedElement, processRemovedNodes, processUnmarkInUseNodes, processVisitedNodes, prune, resetEvictionQueue, setEvictionActionPolicy, toString |
FIFOAlgorithm
public FIFOAlgorithm()
setupEvictionQueue
protected EvictionQueue setupEvictionQueue()
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
- Returns:
- The created EvictionQueue to be used as the eviction queue for this algorithm.
- Throws:
EvictionException
- if there are problems- 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.
getConfigurationClass
public Class<? extends EvictionAlgorithmConfig> getConfigurationClass()
- Description copied from interface:
EvictionAlgorithm
- This is a helper so that the XML parser will be able to select and use the correct
EvictionAlgorithmConfig
implementation
class corresponding to this EvictionAlgorithm. E.g., the FIFOAlgorithm
would return FIFOAlgorithmConfig
.class.
- Returns:
- a class that is used to configure this EvictionAlgorithm.
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.