iiitToolkit 1.0

de.iiit.cache
Class GenericInvalidationCache

java.lang.Object
  |
  +--de.iiit.cache.GenericCache
        |
        +--de.iiit.cache.GenericInvalidationCache

public class GenericInvalidationCache
extends GenericCache

A cache with a guaranteed maximum lifetime of each entry

Version:
$Revision: 1.7 $ $Date: 2003/01/01 21:03:49 $

Constructor Summary
GenericInvalidationCache()
          Creates a new instance of GenericInvalidationCache
GenericInvalidationCache(long invalidationTimeout)
          Creates a new instance of GenericInvalidationCache
 
Method Summary
 void addElement(Object key, Object value)
          Add a new element to the cache.
 Object getElement(Object key)
          Retrieves an cache-entry.
 
Methods inherited from class de.iiit.cache.GenericCache
clear, getKeys, removeElement, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericInvalidationCache

public GenericInvalidationCache()
Creates a new instance of GenericInvalidationCache


GenericInvalidationCache

public GenericInvalidationCache(long invalidationTimeout)
Creates a new instance of GenericInvalidationCache

Parameters:
invalidationTimeout - The maximum lifetime of the entries
Method Detail

addElement

public void addElement(Object key,
                       Object value)
Add a new element to the cache. If an element with the same key already exists it will be replaced.

Overrides:
addElement in class GenericCache
Parameters:
key - The unique key of the cache entry
value - The unique key of the cache entry

getElement

public Object getElement(Object key)
                  throws CacheFaultException
Retrieves an cache-entry. If the cache entry is older than the maximum lifetime it will be removed instead.

Overrides:
getElement in class GenericCache
Parameters:
key - The unique key of the cache entry to retrieve
Returns:
The cache entry with the given key
Throws:
CacheFaultException - if there is no entry with the given key or if the entry is to old.

iiitToolkit 1.0

Copyright © 2002, 2003 ingeneurbuero fuer innovative informationstechnik, Dipl.-Ing. Joerg Beckmann, Dortmund, Germany. All Rights Reserved.
See Copyright statement