org.jboss.jca.adapters.jdbc.util
Class LRUCachePolicy.LRUList

java.lang.Object
  extended by org.jboss.jca.adapters.jdbc.util.LRUCachePolicy.LRUList
Enclosing class:
LRUCachePolicy

public class LRUCachePolicy.LRUList
extends Object

Double queued list used to store cache entries.


Constructor Summary
protected LRUCachePolicy.LRUList()
          Creates a new double queued list.
 
Method Summary
protected  void capacityChanged(int oldCapacity)
          Callback that signals that the capacity of the cache is changed.
protected  void clear()
          clear
protected  void demote()
          Demotes from the cache the least used entry.
protected  void entryAdded(LRUCachePolicy.LRUCacheEntry entry)
          Callback that signals that the given entry has been added to the cache.
protected  void entryPromotion(LRUCachePolicy.LRUCacheEntry entry)
          Callback that signals that the given entry is just about to be added.
protected  void entryRemoved(LRUCachePolicy.LRUCacheEntry entry)
          Callback that signals that the given entry has been removed from the cache.
 int getCacheMiss()
          Get the cacheMiss.
 int getCapacity()
          Get the capacity.
 int getCount()
          Get the count.
 LRUCachePolicy.LRUCacheEntry getHead()
          Get the head.
 int getMaxCapacity()
          Get the maxCapacity.
 int getMinCapacity()
          Get the minCapacity.
 LRUCachePolicy.LRUCacheEntry getTail()
          Get the tail.
protected  void promote(LRUCachePolicy.LRUCacheEntry entry)
          Promotes the cache entry entry to the last used position of the list.
protected  void remove(LRUCachePolicy.LRUCacheEntry entry)
          Removes from the cache list the specified entry.
 void setCacheMiss(int cacheMiss)
          Set the cacheMiss.
 void setCapacity(int capacity)
          Set the capacity.
 void setCount(int count)
          Set the count.
 void setHead(LRUCachePolicy.LRUCacheEntry head)
          Set the head.
 void setMaxCapacity(int maxCapacity)
          Set the maxCapacity.
 void setMinCapacity(int minCapacity)
          Set the minCapacity.
 void setTail(LRUCachePolicy.LRUCacheEntry tail)
          Set the tail.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LRUCachePolicy.LRUList

protected LRUCachePolicy.LRUList()
Creates a new double queued list.

Method Detail

promote

protected void promote(LRUCachePolicy.LRUCacheEntry entry)
Promotes the cache entry entry to the last used position of the list.
If the object is already there, does nothing.

Parameters:
entry - the object to be promoted, cannot be null
Throws:
IllegalStateException - if this method is called with a full cache
See Also:
demote()

demote

protected void demote()
Demotes from the cache the least used entry.
If the cache is not full, does nothing.

See Also:
promote(org.jboss.jca.adapters.jdbc.util.LRUCachePolicy.LRUCacheEntry)

remove

protected void remove(LRUCachePolicy.LRUCacheEntry entry)
Removes from the cache list the specified entry.

Parameters:
entry - entry

entryPromotion

protected void entryPromotion(LRUCachePolicy.LRUCacheEntry entry)
Callback that signals that the given entry is just about to be added.

Parameters:
entry - entry

entryAdded

protected void entryAdded(LRUCachePolicy.LRUCacheEntry entry)
Callback that signals that the given entry has been added to the cache.

Parameters:
entry - entry

entryRemoved

protected void entryRemoved(LRUCachePolicy.LRUCacheEntry entry)
Callback that signals that the given entry has been removed from the cache.

Parameters:
entry - entry

capacityChanged

protected void capacityChanged(int oldCapacity)
Callback that signals that the capacity of the cache is changed.

Parameters:
oldCapacity - the capacity before the change happened

clear

protected void clear()
clear


toString

public String toString()
Overrides:
toString in class Object

getMaxCapacity

public final int getMaxCapacity()
Get the maxCapacity.

Returns:
the maxCapacity.

setMaxCapacity

public final void setMaxCapacity(int maxCapacity)
Set the maxCapacity.

Parameters:
maxCapacity - The maxCapacity to set.

getMinCapacity

public final int getMinCapacity()
Get the minCapacity.

Returns:
the minCapacity.

setMinCapacity

public final void setMinCapacity(int minCapacity)
Set the minCapacity.

Parameters:
minCapacity - The minCapacity to set.

getCapacity

public final int getCapacity()
Get the capacity.

Returns:
the capacity.

setCapacity

public final void setCapacity(int capacity)
Set the capacity.

Parameters:
capacity - The capacity to set.

getCount

public final int getCount()
Get the count.

Returns:
the count.

setCount

public final void setCount(int count)
Set the count.

Parameters:
count - The count to set.

getHead

public final LRUCachePolicy.LRUCacheEntry getHead()
Get the head.

Returns:
the head.

setHead

public final void setHead(LRUCachePolicy.LRUCacheEntry head)
Set the head.

Parameters:
head - The head to set.

getTail

public final LRUCachePolicy.LRUCacheEntry getTail()
Get the tail.

Returns:
the tail.

setTail

public final void setTail(LRUCachePolicy.LRUCacheEntry tail)
Set the tail.

Parameters:
tail - The tail to set.

getCacheMiss

public final int getCacheMiss()
Get the cacheMiss.

Returns:
the cacheMiss.

setCacheMiss

public final void setCacheMiss(int cacheMiss)
Set the cacheMiss.

Parameters:
cacheMiss - The cacheMiss to set.


Copyright © 2008 Red Hat Middleware LLC (http://www.jboss.com/)