com.microstrategy.utils.cache.Cache |
Cache interface. Cache is a collection of objects that are loaded from the persistent storage and cached in the memory.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
clear()
Clears the cache - all entries are removed.
| ||||||||||
abstract void |
close()
Un-register cache from the cache registry.
| ||||||||||
abstract boolean | contains(CacheHint hint) | ||||||||||
abstract void |
delete(CacheHint hint)
Removes object from the cache and persistent storage
| ||||||||||
abstract Object |
get(CacheHint hint)
Finds and returns cached object based on the hint.
| ||||||||||
abstract String |
getName()
Returns cache name.
| ||||||||||
abstract void |
onHintClose(CacheHint hint)
This method is supposed to be called by the hint object when it is closed.
| ||||||||||
abstract void |
put(CacheHint hint, Object ob)
Puts the object in the cache.
| ||||||||||
abstract Object |
refresh(CacheHint hint)
Re-loads object from the persistent storage
| ||||||||||
abstract void |
remove(CacheHint hint)
Removes an object from the cache.
| ||||||||||
abstract void |
save(CacheHint hint, Object ob)
Puts the object in the cache and stores it in the memory.
|
Clears the cache - all entries are removed.
Un-register cache from the cache registry. Cache shall not be used after this call.
Removes object from the cache and persistent storage
hint | the hint object. |
---|
CacheException | if attempt to extract key from the hint failed or if attempt to remove obect from the persistent storage failed |
---|
Finds and returns cached object based on the hint. If object does not exists in the memory it will be loaded from the persistent memory. Returns null if object does not exists in persistent memory either.
hint | the hint object. |
---|
CacheException | if attempt to load object from the persistent memory faild with exception |
---|
Returns cache name.
This method is supposed to be called by the hint object when it is closed. Cache implementations shall use this call to perform proper cache cleanup.
hint | the hint object. |
---|
Puts the object in the cache. If cache already contains object corresponding to the specified hint it will be replaced with the new one.
hint | the hint object. |
---|---|
ob | object to be cached |
CacheException | if attempt to extract key from the hint failed |
---|
Re-loads object from the persistent storage
hint | the hint object. |
---|
CacheException | if attempt to extract key from the hint failed or if attempt to re-load obect from the persistent storage failed |
---|
Removes an object from the cache.
hint | the hint object. |
---|
CacheException | Thrown when error occurs during removing the object. |
---|
Puts the object in the cache and stores it in the memory. Normally this method will be called after application obtained an object from the cache and modified it. But it is also possible to use this method to replace cached object with another one or to add to the cache and to the persistent storage a new object.
hint | the hint object. |
---|---|
ob | object to be cached |
CacheException | if attempt to extract key from the hint failed or if attempt to store obect in the persistent storage failed |
---|