org.shiftone.cache.policy
Class AbstractPolicyCacheFactory

java.lang.Object
  extended byorg.shiftone.cache.policy.AbstractPolicyCacheFactory
All Implemented Interfaces:
CacheFactory
Direct Known Subclasses:
FifoCacheFactory, LfuCacheFactory, LruCacheFactory

public abstract class AbstractPolicyCacheFactory
extends java.lang.Object
implements CacheFactory

Version:
$Revision: 1.1 $
Author:
$Author: jeffdrost $

Constructor Summary
AbstractPolicyCacheFactory()
           
 
Method Summary
 EvictionListener getEvictionListener()
           
 int getPeriod()
          time in milliseconds between calls from the reaper.
 Cache newInstance(java.lang.String cacheName, long timeoutMilliSeconds, int maxSize)
           
abstract  ReapableCache newReapableCache(java.lang.String cacheName, long timeoutMilliSeconds, int maxSize, EvictionListener listener)
           
 void setEvictionListenerClass(java.lang.Class evictionListenerClass)
           
 void setPeriod(int period)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPolicyCacheFactory

public AbstractPolicyCacheFactory()
Method Detail

newReapableCache

public abstract ReapableCache newReapableCache(java.lang.String cacheName,
                                               long timeoutMilliSeconds,
                                               int maxSize,
                                               EvictionListener listener)

newInstance

public Cache newInstance(java.lang.String cacheName,
                         long timeoutMilliSeconds,
                         int maxSize)
Specified by:
newInstance in interface CacheFactory

getPeriod

public int getPeriod()
time in milliseconds between calls from the reaper. Every "period" milliseconds this factory's reaper will wake up and call "removeExpiredElements" on the cache. Note that changing this value will only effect new caches - all existing caches will continue with the same period.


setPeriod

public void setPeriod(int period)

setEvictionListenerClass

public void setEvictionListenerClass(java.lang.Class evictionListenerClass)

getEvictionListener

public EvictionListener getEvictionListener()