no.feide.moria.store
Class TicketTTLEvictionAlgorithm

java.lang.Object
  extended by no.feide.moria.store.TicketTTLEvictionAlgorithm
All Implemented Interfaces:
org.jboss.cache.eviction.EvictionAlgorithm

public final class TicketTTLEvictionAlgorithm
extends java.lang.Object
implements org.jboss.cache.eviction.EvictionAlgorithm

This eviction algorithm expires cache elements after a fixed period, aka Time To Live.

Version:
$Revision: 1.10 $
Author:
Bjørn Ola Smievoll <b.o.smievoll@conduct.no>

Nested Class Summary
private static class TicketTTLEvictionAlgorithm.NodeEntry
          Represents a cache node.
 
Field Summary
private  no.feide.moria.log.MessageLogger messageLogger
          The logger used by this class.
private  EDU.oswego.cs.dl.util.concurrent.SyncList nodeList
          Synchronized list of nodes.
private  EDU.oswego.cs.dl.util.concurrent.SyncMap nodeMap
          Synchronized hash map of nodes.
 
Constructor Summary
TicketTTLEvictionAlgorithm()
          Constructs a new instance.
 
Method Summary
 void process(org.jboss.cache.eviction.Region region)
          Perfoms the eviction algorithm.
private  void processAddedNodes(org.jboss.cache.eviction.Region region, org.jboss.cache.Fqn fqn)
          Adds nodes to eviction data structures.
private  void processRemovedNodes(org.jboss.cache.Fqn fqn)
          Removes nodes from eviction data structures.
private  void prune(org.jboss.cache.eviction.Region region)
          Prunes a region of the tree.
 void resetEvictionQueue(org.jboss.cache.eviction.Region region)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageLogger

private final no.feide.moria.log.MessageLogger messageLogger
The logger used by this class.


nodeList

private EDU.oswego.cs.dl.util.concurrent.SyncList nodeList
Synchronized list of nodes.


nodeMap

private EDU.oswego.cs.dl.util.concurrent.SyncMap nodeMap
Synchronized hash map of nodes.

Constructor Detail

TicketTTLEvictionAlgorithm

public TicketTTLEvictionAlgorithm()
Constructs a new instance.

Method Detail

process

public void process(org.jboss.cache.eviction.Region region)
             throws org.jboss.cache.eviction.EvictionException
Perfoms the eviction algorithm. Called periodically.

Specified by:
process in interface org.jboss.cache.eviction.EvictionAlgorithm
Throws:
org.jboss.cache.eviction.EvictionException
See Also:
EvictionAlgorithm.process(org.jboss.cache.eviction.Region)

resetEvictionQueue

public void resetEvictionQueue(org.jboss.cache.eviction.Region region)
Specified by:
resetEvictionQueue in interface org.jboss.cache.eviction.EvictionAlgorithm

processAddedNodes

private void processAddedNodes(org.jboss.cache.eviction.Region region,
                               org.jboss.cache.Fqn fqn)
Adds nodes to eviction data structures.

Parameters:
region - Region of tree.
fqn - Fully qualified name.

processRemovedNodes

private void processRemovedNodes(org.jboss.cache.Fqn fqn)
Removes nodes from eviction data structures.

Parameters:
fqn - Fully qualified name.

prune

private void prune(org.jboss.cache.eviction.Region region)
            throws org.jboss.cache.eviction.EvictionException
Prunes a region of the tree.

Parameters:
region - Region of tree.
Throws:
org.jboss.cache.eviction.EvictionException - If eviction is interrupted or fails.


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.