org.jwarp.service.cache
Interface ICache

All Known Implementing Classes:
Cache

public interface ICache

Abstract interface for a simple cache.


Method Summary
 void flush()
          Flushes the cache.
 java.lang.Object get(java.lang.Object key)
          Gets a cached object with the given key.
 boolean getDebugging()
          Returns true if debugging is switched on.
 java.util.Enumeration getKeys()
          Returns an enumeration of all currently cached object keys.
 int getObjectCount()
          Gets the actual number of cached objects.
 java.util.Enumeration getObjects()
          Returns an enumeration of all currently cached objects.
 void put(java.lang.Object key, java.lang.Object bean)
          Puts an new object in the cache.
 java.lang.Object remove(java.lang.Object key)
          Removes an object from the cache.
 void setDebugging(boolean val)
          Turn on/off debugging.
 void setMaxComponents(int number)
          Set the maximum numbers of objects of the cache.
 void setMaxTime(long maxTime)
          Sets the maximal time in millis an object is kept in the cache.
 void setMinAccess(int minAccess)
          Setting the minimal accesses needed to keep an object.
 void setReactionSensibility(int sens)
          Sets the sehnsibility when an dynamic cache is implemented.
 void setUpdateIntervall(long millis)
          Set the update period of the cache.
 void updateCache()
          Updates the cache.
 

Method Detail

get

public java.lang.Object get(java.lang.Object key)
Gets a cached object with the given key.

put

public void put(java.lang.Object key,
                java.lang.Object bean)
Puts an new object in the cache.

remove

public java.lang.Object remove(java.lang.Object key)
Removes an object from the cache.

setUpdateIntervall

public void setUpdateIntervall(long millis)
Set the update period of the cache.

setMaxComponents

public void setMaxComponents(int number)
Set the maximum numbers of objects of the cache.

setMinAccess

public void setMinAccess(int minAccess)
Setting the minimal accesses needed to keep an object. Set this to -1 if you want to ignore this setting.

setMaxTime

public void setMaxTime(long maxTime)
Sets the maximal time in millis an object is kept in the cache. Set this to -1 if you want not to limit the lifetime of an object in the cache.

setReactionSensibility

public void setReactionSensibility(int sens)
Sets the sehnsibility when an dynamic cache is implemented.

getObjectCount

public int getObjectCount()
Gets the actual number of cached objects.

flush

public void flush()
Flushes the cache.

getObjects

public java.util.Enumeration getObjects()
Returns an enumeration of all currently cached objects.

getKeys

public java.util.Enumeration getKeys()
Returns an enumeration of all currently cached object keys.

setDebugging

public void setDebugging(boolean val)
Turn on/off debugging.

getDebugging

public boolean getDebugging()
Returns true if debugging is switched on.

updateCache

public void updateCache()
Updates the cache. This is typically called by a thread running independently.

©   O R C A   S y s t e m s