Keel 2.1RC2

org.keel.services.cache
Interface Cache

All Known Implementing Classes:
ConfigurableCache, TurbineGlobalCacheService

public interface Cache

General-purpose Bean

Version:
$Revision: 1.2 $ $Date: 2003/07/03 15:49:33 $

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 void addObject(java.lang.String id, java.lang.Object o)
          Adds an object to the cache.
 void flushCache()
          Flush the cache of all objects.
 int getCacheSize()
          Returns the current size of the cache.
 int getNumberOfObjects()
          Returns the number of objects in the cache.
 java.lang.Object getObject(java.lang.String id)
          Gets a cached object given its id (a String).
 void removeObject(java.lang.String id)
          Removes an object from the cache.
 

Field Detail

ROLE

public static final java.lang.String ROLE
See Also:
Constant Field Values
Method Detail

getObject

public java.lang.Object getObject(java.lang.String id)
                           throws NestedException
Gets a cached object given its id (a String).

Parameters:
id - The String id for the object.
Returns:
A CachedObject.
Throws:
ObjectExpiredException, - if the object has expired in the cache.
NestedException

addObject

public void addObject(java.lang.String id,
                      java.lang.Object o)
Adds an object to the cache.

Parameters:
id - The String id for the object.
o - The object to add to the cache.

removeObject

public void removeObject(java.lang.String id)
Removes an object from the cache.

Parameters:
id - The String id for the object.

getCacheSize

public int getCacheSize()
                 throws NestedException
Returns the current size of the cache.

Returns:
int representing current cache size in number of bytes
Throws:
NestedException

getNumberOfObjects

public int getNumberOfObjects()
Returns the number of objects in the cache.

Returns:
int The current number of objects in the cache.

flushCache

public void flushCache()
Flush the cache of all objects.


Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.