org.jboss.cache.eviction
Interface EvictionQueue

All Known Subinterfaces:
SortedEvictionQueue
All Known Implementing Classes:
FIFOQueue, LFUQueue, LRUQueue, MRUQueue

public interface EvictionQueue

Eviction Queue interface defines a contract for the Eviction Queue implementations used by EvictionPolicies.

Note: None of the Eviction classes are thread safe. It is assumed that an individual instance of an EvictionPolicy/ EvictionAlgorithm/EvictionQueue/EvictionConfiguration are only operated on by one thread at any given time.

Version:
$Revision: 1.1 $
Author:
Daniel Huang (dhuang@jboss.org)

Method Summary
 void addNodeEntry(NodeEntry entry)
          Add a NodeEntry to the queue.
 void clear()
          Clear the queue.
 boolean containsNodeEntry(NodeEntry entry)
          Check if queue contains the given NodeEntry.
 NodeEntry getFirstNodeEntry()
          Get the first entry in the queue.
 NodeEntry getNodeEntry(Fqn fqn)
          Retrieve a node entry by Fqn.
 NodeEntry getNodeEntry(java.lang.String fqn)
           
 void removeNodeEntry(NodeEntry entry)
          Remove a NodeEntry from queue.
 int size()
          Get the size of the queue.
 

Method Detail

getFirstNodeEntry

NodeEntry getFirstNodeEntry()
Get the first entry in the queue.

If there are no entries in queue, this method will return null.

The first node returned is expected to be the first node to evict.

Returns:
first NodeEntry in queue.

getNodeEntry

NodeEntry getNodeEntry(Fqn fqn)
Retrieve a node entry by Fqn.

This will return null if the entry is not found.

Parameters:
fqn - Fqn of the node entry to retrieve.
Returns:
Node Entry object associated with given Fqn param.

getNodeEntry

NodeEntry getNodeEntry(java.lang.String fqn)

containsNodeEntry

boolean containsNodeEntry(NodeEntry entry)
Check if queue contains the given NodeEntry.

Parameters:
entry - NodeEntry to check for existence in queue.
Returns:
true/false if NodeEntry exists in queue.

removeNodeEntry

void removeNodeEntry(NodeEntry entry)
Remove a NodeEntry from queue.

If the NodeEntry does not exist in the queue, this method will return normally.

Parameters:
entry - The NodeEntry to remove from queue.

addNodeEntry

void addNodeEntry(NodeEntry entry)
Add a NodeEntry to the queue.

Parameters:
entry - The NodeEntry to add to queue.

size

int size()
Get the size of the queue.

Returns:
The number of items in the queue.

clear

void clear()
Clear the queue.



Copyright © 1998-2005 JBoss Inc . All Rights Reserved.