Package org.apache.fulcrum.cache
Interface GlobalCacheService
- All Known Implementing Classes:
- DefaultGlobalCacheService,- EHCacheService,- JCSCacheService
public interface GlobalCacheService
GlobalCacheService interface.
- Version:
- $Id$
- Author:
- Dave Bryson, Peter CourefreshableCachedObjectux
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescription<T> voidaddObject(String objectId, CachedObject<T> object) Adds an object to the cache.voidFlush the cache of all objects.List<CachedObject<?>> Returns a copy of the non-expired CachedObjects in the cache as a list.intReturns the current size of the cache.getKeys()Returns a copy of keys to objects in the cache as a list.intReturns the number of objects in the cache.<T> CachedObject<T> Gets a cached object given its id (a String).voidremoveObject(String objectId) Removes an object from the cache.
- 
Field Details- 
ROLEAvalon role - used to id the component within the manager
 
- 
- 
Method Details- 
getObjectGets a cached object given its id (a String).- Type Parameters:
- T- type of object to return
- Parameters:
- objectId- The String id for the object.
- Returns:
- A CachedObject.
- Throws:
- ObjectExpiredException- if the object has expired in the cache.
 
- 
addObjectAdds an object to the cache.- Type Parameters:
- T- type of object to add
- Parameters:
- objectId- The String id for the object.
- object- The object to add to the cache.
 
- 
removeObjectRemoves an object from the cache.- Parameters:
- objectId- The String id for the object.
 
- 
getKeysReturns a copy of keys to objects in the cache as a list. Note that keys to expired objects are not returned.- Returns:
- A List of String's representing the keys to objects in the cache.
 
- 
getCachedObjectsList<CachedObject<?>> getCachedObjects()Returns a copy of the non-expired CachedObjects in the cache as a list.- Returns:
- A List of CachedObjectobjects held in the cache
 
- 
getCacheSizeReturns the current size of the cache.- Returns:
- int representing current cache size in number of bytes
- Throws:
- IOException- if unable to return cache size
 
- 
getNumberOfObjectsint getNumberOfObjects()Returns the number of objects in the cache.- Returns:
- int The current number of objects in the cache.
 
- 
flushCachevoid flushCache()Flush the cache of all objects.
 
-