Package com.easydesk.cache
Interface GlobalCacheService
- All Known Implementing Classes:
JCSCacheService
public interface GlobalCacheService
Contract for a global (application-wide) object cache.
This is the same contract as Apache Fulcrum's
org.apache.fulcrum.cache.GlobalCacheService, minus the Avalon
ROLE constant (Avalon's string-based component lookup has no
Spring equivalent, and none is needed -- Spring resolves beans by type).
-
Method Summary
Modifier and TypeMethodDescription<T> voidaddObject(String objectId, CachedObject<T> cachedObject) voidRemoves every object from the cache.List<CachedObject<?>> intgetKeys()int<T> CachedObject<T> voidremoveObject(String objectId)
-
Method Details
-
getObject
- Type Parameters:
T- type of object to return- Parameters:
objectId- the String id for the object- Returns:
- the cached object
- Throws:
ObjectExpiredException- if the object has expired or is not present
-
addObject
- Type Parameters:
T- type of object to add- Parameters:
objectId- the String id for the objectcachedObject- the object to add to the cache
-
removeObject
- Parameters:
objectId- the String id for the object
-
getKeys
- Returns:
- keys of the (non-expired) objects currently in the cache
-
getCachedObjects
List<CachedObject<?>> getCachedObjects()- Returns:
- the non-expired
CachedObjects currently in the cache
-
getCacheSize
- Returns:
- the current size of the cache, in bytes
- Throws:
IOException- if unable to compute the cache size
-
getNumberOfObjects
int getNumberOfObjects()- Returns:
- the number of objects currently in the cache
-
flushCache
void flushCache()Removes every object from the cache.
-