| java.lang.Object org.shiftone.cache.util.AbstractPolicyCache
All known Subclasses: org.shiftone.cache.policy.lru.LruCache, org.shiftone.cache.policy.lfu.LfuCache, org.shiftone.cache.policy.fifo.FifoCache,
AbstractPolicyCache | abstract public class AbstractPolicyCache implements ReapableCache(Code) | | Class AbstractPolicyCache
author: Jeff Drost version: $Revision: 1.5 $ |
SHRINK_DIV | final public static int SHRINK_DIV(Code) | | |
AbstractPolicyCache | protected AbstractPolicyCache(String name, long timeoutMilliSeconds, int maxSize)(Code) | | |
clear | public void clear()(Code) | | This method calls shrinkToSize(0) which will loop through
each element, removing them one by one (in order of lease valued
to most valued). Derived classes may wish to implement this in a
more efficient way (by just reinitalizing itself).
|
delete | abstract protected void delete(CacheNode node)(Code) | | Remove a node from the cache.
|
getMaxSize | final protected int getMaxSize()(Code) | | |
getTimeoutMilliSeconds | final protected long getTimeoutMilliSeconds()(Code) | | |
removeExpiredElements | abstract public void removeExpiredElements()(Code) | | Purge the cache of expired elements.
|
removeLeastValuableNode | abstract protected void removeLeastValuableNode()(Code) | | This method will execute the cache's eviction strategy.
If this method is called, there will be at least one
element in the cache to remove. The method itself does
not need to check for the existance of a element.
This method is only called by shrinkToSize();
|
revalueNode | abstract protected void revalueNode(CacheNode node)(Code) | | Update the node's value. This is done immediately after
the node is retrieved.
|
|
|