org.deegree.tools
Interface Cache

All Known Implementing Classes:
Cache_Impl

public interface Cache

The interface describes the access to a cache.

---------------------------------------------------------------------

Version:
$Revision: 1.2 $ $Date: 2004/02/09 07:57:02 $
Author:
Andreas Poth

Method Summary
 void clear()
          removes all entries from the cache
 java.lang.Object get(java.lang.Object identifier)
          gets an entry from the cache.
 int getCurrentSize()
          returns the actual amount of entries within the cache
 int getMaxEntries()
          returns the number of entries maximal allowed within the cache
 int getMaxLifeTime()
          sets the maximal time (milliseconds) an entry will be stored within the cache without being called.
 void push(java.lang.Object identifier, java.lang.Object data)
          pushes a new entry to the cache.
 java.lang.Object remove(java.lang.Object identifier)
          removes an entry from the cache.
 void setMaxEntries(int maxEntries)
          sets the number of entries maximal allowed within the cache
 void setMaxLifeTime(int maxLifeTime)
          sets the maximal time (milliseconds) an entry will be stored within the cache without being called.
 

Method Detail

setMaxEntries

public void setMaxEntries(int maxEntries)
sets the number of entries maximal allowed within the cache


getMaxEntries

public int getMaxEntries()
returns the number of entries maximal allowed within the cache


setMaxLifeTime

public void setMaxLifeTime(int maxLifeTime)
sets the maximal time (milliseconds) an entry will be stored within the cache without being called. If an entry is called through the get-method the timestamp will be refreshed.


getMaxLifeTime

public int getMaxLifeTime()
sets the maximal time (milliseconds) an entry will be stored within the cache without being called.


getCurrentSize

public int getCurrentSize()
returns the actual amount of entries within the cache


clear

public void clear()
removes all entries from the cache


push

public void push(java.lang.Object identifier,
                 java.lang.Object data)
pushes a new entry to the cache. Each entry is marked by an unique identifier


get

public java.lang.Object get(java.lang.Object identifier)
gets an entry from the cache. The entry that shall be returned will be identified by the submitted identifier. If no entry for a submitted identifier can be found within the cache the method shall return null.


remove

public java.lang.Object remove(java.lang.Object identifier)
removes an entry from the cache. The entry that shall be removed will be identified by the submitted identifier. The removed entry will be returned. If no entry for a submitted identifier can be found within the cache the method shall return null.