| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.eviction.BaseEvictionAlgorithm
public abstract class BaseEvictionAlgorithm
Abstract Event Processing Eviction Algorithm. This class is used to implement basic event processing for Eviction Algorithms. To extend this abstract class to make an Eviction Algorithm, implement the abstract methods and a policy.
| Field Summary | |
|---|---|
protected  EvictionQueue | 
evictionQueue
Contains NodeEntry instances.  | 
protected  EDU.oswego.cs.dl.util.concurrent.BoundedBuffer | 
recycleQueue
Contains Fqn instances.  | 
protected  Region | 
region
Mapped region.  | 
| Constructor Summary | |
|---|---|
protected  | 
BaseEvictionAlgorithm()
 | 
| Method Summary | |
|---|---|
protected  void | 
emptyRecycleQueue()
Empty the Recycle Queue.  | 
protected  void | 
evict(NodeEntry ne)
 | 
protected  boolean | 
evictCacheNode(Fqn fqn)
Evict a node from cache.  | 
 EvictionQueue | 
getEvictionQueue()
Get the underlying EvictionQueue implementation.  | 
protected  void | 
initialize(Region region)
 | 
protected  boolean | 
isNodeInUseAndNotTimedOut(NodeEntry ne)
 | 
 void | 
process(Region region)
Process the given region.  | 
protected  void | 
processAddedElement(Fqn fqn)
 | 
protected  void | 
processAddedNodes(Fqn fqn,
                  int numAddedElements,
                  boolean resetElementCount)
 | 
protected  void | 
processMarkInUseNodes(Fqn fqn,
                      long inUseTimeout)
 | 
protected  void | 
processQueues(Region region)
Event processing for Evict/Add/Visiting of nodes.  | 
protected  void | 
processRemovedElement(Fqn fqn)
 | 
protected  void | 
processRemovedNodes(Fqn fqn)
Remove a node from cache.  | 
protected  void | 
processUnmarkInUseNodes(Fqn fqn)
 | 
protected  void | 
processVisitedNodes(Fqn fqn)
Visit a node in cache.  | 
protected  void | 
prune()
 | 
 void | 
resetEvictionQueue(Region region)
Reset the whole eviction queue.  | 
protected abstract  EvictionQueue | 
setupEvictionQueue(Region region)
This method will create an EvictionQueue implementation and prepare it for use.  | 
protected abstract  boolean | 
shouldEvictNode(NodeEntry ne)
This method will check whether the given node should be evicted or not.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected Region region
protected EDU.oswego.cs.dl.util.concurrent.BoundedBuffer recycleQueue
protected EvictionQueue evictionQueue
| Constructor Detail | 
|---|
protected BaseEvictionAlgorithm()
| Method Detail | 
|---|
protected abstract EvictionQueue setupEvictionQueue(Region region)
                                             throws EvictionException
region - Region to setup an eviction queue for.
EvictionExceptionEvictionQueueprotected abstract boolean shouldEvictNode(NodeEntry ne)
ne - NodeEntry to test eviction for.
protected void initialize(Region region)
                   throws EvictionException
EvictionException
public void process(Region region)
             throws EvictionException
process in interface EvictionAlgorithmregion - Cache region to process for eviction.
EvictionExceptionpublic void resetEvictionQueue(Region region)
EvictionAlgorithm
resetEvictionQueue in interface EvictionAlgorithmregion - Region that this algorithm will operate on.public EvictionQueue getEvictionQueue()
getEvictionQueue in interface EvictionAlgorithmEvictionQueue
protected void processQueues(Region region)
                      throws EvictionException
region - Cache region to process for eviction.
EvictionExceptionprotected void evict(NodeEntry ne)
protected boolean evictCacheNode(Fqn fqn)
fqn - node corresponds to this fqn
protected void processMarkInUseNodes(Fqn fqn,
                                     long inUseTimeout)
                              throws EvictionException
EvictionException
protected void processUnmarkInUseNodes(Fqn fqn)
                                throws EvictionException
EvictionException
protected void processAddedNodes(Fqn fqn,
                                 int numAddedElements,
                                 boolean resetElementCount)
                          throws EvictionException
EvictionException
protected void processRemovedNodes(Fqn fqn)
                            throws EvictionException
fqn - FQN of the removed node
EvictionException
protected void processVisitedNodes(Fqn fqn)
                            throws EvictionException
fqn - FQN of the visited node.
EvictionException
protected void processRemovedElement(Fqn fqn)
                              throws EvictionException
EvictionException
protected void processAddedElement(Fqn fqn)
                            throws EvictionException
EvictionException
protected void emptyRecycleQueue()
                          throws EvictionException
EvictionExceptionprotected boolean isNodeInUseAndNotTimedOut(NodeEntry ne)
protected void prune()
              throws EvictionException
EvictionException
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||