|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - the class of the data stored in the cache.public interface Cache<T>
Cache interface. Used to add/get/remove value from cache which can be local or distributed, with a limited capacity etc. depending of the implementation and configuration.
You can create a new cache using the CacheFactory component.
| Method Summary | |
|---|---|
void |
addCacheEntryListener(CacheEntryListener<T> listener)
Add the provided listener to the cache to catch events on entries like add, remove etc. |
void |
dispose()
Release all the resources this cache use. |
T |
get(java.lang.String key)
|
void |
remove(java.lang.String key)
Remove the entry associated with the provided key from the cache. |
void |
removeAll()
Remove all the entries the cache contains. |
void |
removeCacheEntryListener(CacheEntryListener<T> listener)
Remove the provided listener from the list of listeners. |
void |
set(java.lang.String key,
T value)
Add a new value or overwrite the existing one associated with the provided key. |
| Method Detail |
|---|
void set(java.lang.String key,
T value)
You can catch this events using
CacheEntryListener.cacheEntryAdded(org.xwiki.cache.event.CacheEntryEvent) or
CacheEntryListener.cacheEntryModified(org.xwiki.cache.event.CacheEntryEvent)
key - the associated key used to access the value in the cache.value - the value to store in the cache.T get(java.lang.String key)
key - the key used to access the value in the cache.
void remove(java.lang.String key)
You can catch this events using
CacheEntryListener.cacheEntryRemoved(org.xwiki.cache.event.CacheEntryEvent)
key - the key used to access the value in the cache.void removeAll()
remove(String)void addCacheEntryListener(CacheEntryListener<T> listener)
listener - the implemented listener.void removeCacheEntryListener(CacheEntryListener<T> listener)
listener - the implemented listener.void dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||