rabbit.cache.utils
Class CacheConfigurationBase

java.lang.Object
  extended by rabbit.cache.utils.CacheConfigurationBase
All Implemented Interfaces:
CacheConfiguration

public abstract class CacheConfigurationBase
extends Object
implements CacheConfiguration

A base implementation of cache configuration.

Author:
Robert Olofsson

Constructor Summary
CacheConfigurationBase()
           
 
Method Summary
 long getCacheTime()
          Get the number of miliseconds the cache stores things usually.
 long getMaxSize()
          Get the maximum size for this cache.
 void setCacheTime(long newCacheTime)
          Set the standard expiry-time for CacheEntries
 void setMaxSize(long newMaxSize)
          Set the maximum size for this cache.
 void setup(Logger logger, SProperties config)
          Set the internal state from the given properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface rabbit.cache.CacheConfiguration
getCacheDir
 

Constructor Detail

CacheConfigurationBase

public CacheConfigurationBase()
Method Detail

getMaxSize

public long getMaxSize()
Description copied from interface: CacheConfiguration
Get the maximum size for this cache.

Specified by:
getMaxSize in interface CacheConfiguration
Returns:
the maximum size in bytes this cache.

setMaxSize

public void setMaxSize(long newMaxSize)
Description copied from interface: CacheConfiguration
Set the maximum size for this cache.

Specified by:
setMaxSize in interface CacheConfiguration
Parameters:
newMaxSize - the new maximum size for the cache.

getCacheTime

public long getCacheTime()
Description copied from interface: CacheConfiguration
Get the number of miliseconds the cache stores things usually. This is the standard expiretime for objects, but you can set it for CacheEntries individially if you want to. NOTE 1: dont trust that an object will be in the cache this long. NOTE 2: dont trust that an object will be removed from the cache when it expires.

Specified by:
getCacheTime in interface CacheConfiguration
Returns:
the number of miliseconds objects are stored normally.

setCacheTime

public void setCacheTime(long newCacheTime)
Description copied from interface: CacheConfiguration
Set the standard expiry-time for CacheEntries

Specified by:
setCacheTime in interface CacheConfiguration
Parameters:
newCacheTime - the number of miliseconds to keep objects normally.

setup

public void setup(Logger logger,
                  SProperties config)
Description copied from interface: CacheConfiguration
Set the internal state from the given properties

Specified by:
setup in interface CacheConfiguration
Parameters:
logger - the Logger to use for warnings or errors
config - the properties to use