|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.cache.internal.DefaultCache<T>
T - the class of the data stored in the cache.public class DefaultCache<T>
Default implementation of Cache. Does not really store anything and always return null when trying to get a
value associated with a key.
| Constructor Summary | |
|---|---|
DefaultCache()
|
|
| 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)
|
int |
getSize()
|
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 obj)
Add a new value or overwrite the existing one associated with the provided key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultCache()
| Method Detail |
|---|
public void remove(java.lang.String key)
You can catch this events using
CacheEntryListener.cacheEntryRemoved(org.xwiki.cache.event.CacheEntryEvent)
remove in interface Cache<T>key - the key used to access the value in the cache.Cache.remove(java.lang.String)
public void set(java.lang.String key,
T obj)
You can catch this events using
CacheEntryListener.cacheEntryAdded(org.xwiki.cache.event.CacheEntryEvent) or
CacheEntryListener.cacheEntryModified(org.xwiki.cache.event.CacheEntryEvent)
set in interface Cache<T>key - the associated key used to access the value in the cache.obj - the value to store in the cache.Cache.set(java.lang.String, java.lang.Object)public T get(java.lang.String key)
get in interface Cache<T>key - the key used to access the value in the cache.
Cache.get(java.lang.String)public void removeAll()
removeAll in interface Cache<T>Cache.removeAll()public int getSize()
org.xwiki.cache.Cache#getSize()public void addCacheEntryListener(CacheEntryListener<T> listener)
addCacheEntryListener in interface Cache<T>listener - the implemented listener.Cache.addCacheEntryListener(org.xwiki.cache.event.CacheEntryListener)public void removeCacheEntryListener(CacheEntryListener<T> listener)
removeCacheEntryListener in interface Cache<T>listener - the implemented listener.Cache.removeCacheEntryListener(org.xwiki.cache.event.CacheEntryListener)public void dispose()
dispose in interface Cache<T>Cache.dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||