Keel 2.1RC2

org.keel.services.cache.turbine
Interface GlobalCacheService

All Superinterfaces:
Initializable, Service

public interface GlobalCacheService
extends Service

GlobalCacheService interface.

Version:
$Id: GlobalCacheService.java,v 1.1 2003/05/16 22:34:19 mprn Exp $
Author:

Field Summary
static java.lang.String SERVICE_NAME
           
 
Method Summary
 void addObject(java.lang.String id, CachedObject 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.
 CachedObject 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.
 
Methods inherited from interface org.keel.services.cache.turbine.Service
getConfiguration, getName, getProperties, setName
 
Methods inherited from interface org.apache.avalon.framework.activity.Initializable
initialize
 

Field Detail

SERVICE_NAME

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

getObject

public CachedObject getObject(java.lang.String id)
                       throws ObjectExpiredException
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.
ObjectExpiredException

addObject

public void addObject(java.lang.String id,
                      CachedObject 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 java.io.IOException
Returns the current size of the cache.

Returns:
int representing current cache size in number of bytes
Throws:
java.io.IOException

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.