rabbit.cache
Interface CacheConfiguration

All Known Implementing Classes:
CacheConfigurationBase

public interface CacheConfiguration

A description of cache configuration.

Author:
Robert Olofsson

Method Summary
 URL getCacheDir()
          Get the location where this cache stores its files.
 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
 

Method Detail

getMaxSize

long getMaxSize()
Get the maximum size for this cache.

Returns:
the maximum size in bytes this cache.

setMaxSize

void setMaxSize(long newMaxSize)
Set the maximum size for this cache.

Parameters:
newMaxSize - the new maximum size for the cache.

getCacheTime

long getCacheTime()
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.

Returns:
the number of miliseconds objects are stored normally.

setCacheTime

void setCacheTime(long newCacheTime)
Set the standard expiry-time for CacheEntries

Parameters:
newCacheTime - the number of miliseconds to keep objects normally.

getCacheDir

URL getCacheDir()
Get the location where this cache stores its files.

Returns:
the location, null if no physical location is used.

setup

void setup(Logger logger,
           SProperties config)
Set the internal state from the given properties

Parameters:
logger - the Logger to use for warnings or errors
config - the properties to use