sfi.director.util.Cache Class Reference

List of all members.

Detailed Description

implements a cache for arbitrary objects.

Each object is associated with a maximum time to live (TTL) after which it is removed from the cache and a time "extension" (each time the object is accessed the minimal time it stays in the cache is extended by the extension period). So the minimum time an object stays in the cache is the "extension" period, the maximum time is the TTL. Every now and then a "garbage collector" wipes "dead" objects out of the cache - independently of if they are still stored or not "dead" objects will never be accessible and be treated like being already wiped out.


Public Member Functions

 Cache ()
 Cache (long ttl)
 Cache (long ttl, long extension)
 Cache (long ttl, long extension, long gcInterval)
void add (Object key, Object contents)
void add (Object key, Object contents, long ttl)
void add (Object key, Object contents, long ttl, long extension)
void gc ()
Object get (Object key)
void remove (Object key)
int size ()
Enumeration elements ()

Package Attributes

Hashtable cache = new Hashtable()
long ttl
long extension
long gcInterval
long nextGc = 0
Thread gcRunning = null

Classes

class  CacheObject


Constructor & Destructor Documentation

sfi.director.util.Cache.Cache  ) 
 

sfi.director.util.Cache.Cache long  ttl  ) 
 

sfi.director.util.Cache.Cache long  ttl,
long  extension
 

sfi.director.util.Cache.Cache long  ttl,
long  extension,
long  gcInterval
 


Member Function Documentation

void sfi.director.util.Cache.add Object  key,
Object  contents,
long  ttl,
long  extension
 

void sfi.director.util.Cache.add Object  key,
Object  contents,
long  ttl
 

void sfi.director.util.Cache.add Object  key,
Object  contents
 

Enumeration sfi.director.util.Cache.elements  ) 
 

void sfi.director.util.Cache.gc  ) 
 

Object sfi.director.util.Cache.get Object  key  ) 
 

void sfi.director.util.Cache.remove Object  key  ) 
 

int sfi.director.util.Cache.size  ) 
 


Member Data Documentation

Hashtable sfi.director.util.Cache.cache = new Hashtable() [package]
 

long sfi.director.util.Cache.extension [package]
 

long sfi.director.util.Cache.gcInterval [package]
 

Thread sfi.director.util.Cache.gcRunning = null [package]
 

long sfi.director.util.Cache.nextGc = 0 [package]
 

long sfi.director.util.Cache.ttl [package]
 


The documentation for this class was generated from the following file:
Generated on Sat Feb 11 01:20:52 2012 for Node Director by  doxygen 1.4.5