public interface ICacheManager
ICacheManager
encapsulates how to physically access
CacheObject
s. It is responsible to save, load & delete the entries.
Furthermore it can be used to delete all CacheObject
s in that cache.Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all
CacheObject s from the cache. |
boolean |
delete(CacheObject cacheObject) |
boolean |
exists(CacheObject cacheObject) |
byte[] |
fromCache(CacheObject cacheObject) |
void |
toCache(CacheObject cacheObject)
Stores the given
CacheObject in the cache. |
void toCache(CacheObject cacheObject) throws java.lang.Exception
CacheObject
in the cache. Overwrites the cached
value if the same object exists already.java.lang.Exception
- if the CacheObject
can not be stored in the cache.byte[] fromCache(CacheObject cacheObject) throws java.lang.Exception
CacheObject
; might be
null
java.lang.Exception
- if the CacheObject
can not be loaded from the cache.boolean exists(CacheObject cacheObject)
true
if the given CacheObject
exists in the
cache; false
otherwise.boolean delete(CacheObject cacheObject)
true
if the given CacheObject
was
successfully deleted.void clear()
CacheObject
s from the cache.