K - the type of keys maintained by this cacheV - the type of cached valuespublic interface ExoCache<K extends Serializable,V>
| Modifier and Type | Method and Description | 
|---|---|
void | 
addCacheListener(org.exoplatform.services.cache.CacheListener<? super K,? super V> listener)
Add a listener. 
 | 
void | 
clearCache()
Clears the cache. 
 | 
V | 
get(Serializable key)
Performs a lookup operation. 
 | 
List<? extends V> | 
getCachedObjects()
Returns a list of cached object that are considered as valid when the method is called. 
 | 
int | 
getCacheHit()
Returns the number of time the cache was queried and a valid entry was returned. 
 | 
int | 
getCacheMiss()
Returns the number of time the cache was queried and no entry was returned. 
 | 
int | 
getCacheSize()
Returns the number of entries in the cache. 
 | 
String | 
getLabel()
Returns the cache label 
 | 
long | 
getLiveTime()
Returns the maximum life time of an entry in the cache. 
 | 
int | 
getMaxSize()
Returns the maximum capacity of the cache. 
 | 
String | 
getName()
Returns the cache name 
 | 
boolean | 
isLogEnabled()  | 
void | 
put(K key,
   V value)
Performs a put in the cache. 
 | 
void | 
putMap(Map<? extends K,? extends V> objs)
Performs a put of all the entries provided by the map argument. 
 | 
V | 
remove(Serializable key)
Removes an entry from the cache. 
 | 
List<? extends V> | 
removeCachedObjects()
Clears the cache and returns the list of cached object that are considered as valid when the method is called. 
 | 
void | 
select(CachedObjectSelector<? super K,? super V> selector)
Selects a subset of the cache. 
 | 
void | 
setLabel(String s)
Sets the cache label 
 | 
void | 
setLiveTime(long period)
Sets the maximum life time of an entry in the cache. 
 | 
void | 
setLogEnabled(boolean b)  | 
void | 
setMaxSize(int max)
Sets the maximum capacity of the cache. 
 | 
void | 
setName(String name)
Sets the cache name. 
 | 
String getName()
void setName(String name)
name - the cache nameString getLabel()
void setLabel(String s)
s - the cache labelV get(Serializable key)
key - the cache keyV remove(Serializable key) throws NullPointerException
key - the cache keyNullPointerException - if the provided key is nullvoid put(K key, V value) throws NullPointerException
key - the cache keyvalue - the cached valueNullPointerException - if the key is nullvoid putMap(Map<? extends K,? extends V> objs) throws NullPointerException, IllegalArgumentException
objs - the objects to putNullPointerException - if the provided argument is nullIllegalArgumentException - if the provided map contains a null keyvoid clearCache()
void select(CachedObjectSelector<? super K,? super V> selector) throws Exception
selector - the selectorException - any exceptionint getCacheSize()
int getMaxSize()
void setMaxSize(int max)
max - the maximum capacitylong getLiveTime()
void setLiveTime(long period)
period - the live timeint getCacheHit()
int getCacheMiss()
List<? extends V> getCachedObjects() throws Exception
Exception - any exceptionList<? extends V> removeCachedObjects()
Exception - any exceptionvoid addCacheListener(org.exoplatform.services.cache.CacheListener<? super K,? super V> listener) throws NullPointerException
listener - the listener to addNullPointerException - if the listener is nullboolean isLogEnabled()
void setLogEnabled(boolean b)
Copyright © 2003-2017 eXo Platform SAS. All Rights Reserved.