|
eXo Kernel :: Component :: Cache Service 2.4.8-GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache<K,V>
public class ConcurrentFIFOExoCache<K extends Serializable,V>
An ExoCache implementation based on ConcurrentHashMap
that minimize locking. Cache entries are maintained in a fifo list that is used for the fifo eviction policy.
| Constructor Summary | |
|---|---|
ConcurrentFIFOExoCache()
|
|
ConcurrentFIFOExoCache(int maxSize)
|
|
ConcurrentFIFOExoCache(int maxSize,
Log log)
|
|
ConcurrentFIFOExoCache(Log log)
|
|
ConcurrentFIFOExoCache(String name,
int maxSize)
|
|
ConcurrentFIFOExoCache(String name,
int maxSize,
Log log)
|
|
| Method Summary | |
|---|---|
void |
addCacheListener(CacheListener<? super K,? super V> listener)
Add a listener. |
void |
assertConsistent()
|
void |
clearCache()
Clears the cache. |
V |
get(Serializable name)
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. |
long |
getLiveTimeMillis()
|
int |
getMaxSize()
Returns the maximum capacity of the cache. |
String |
getName()
Returns the cache name |
boolean |
isLogEnabled()
|
void |
put(K name,
V obj)
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 name)
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 name)
Sets the cache label |
void |
setLiveTime(long period)
Sets the maximum life time of an entry in the cache. |
void |
setLiveTimeMillis(long liveTimeMillis)
|
void |
setLogEnabled(boolean logEnabled)
|
void |
setMaxSize(int max)
Sets the maximum capacity of the cache. |
void |
setName(String s)
Sets the cache name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConcurrentFIFOExoCache()
public ConcurrentFIFOExoCache(Log log)
public ConcurrentFIFOExoCache(int maxSize)
public ConcurrentFIFOExoCache(int maxSize,
Log log)
public ConcurrentFIFOExoCache(String name,
int maxSize)
public ConcurrentFIFOExoCache(String name,
int maxSize,
Log log)
| Method Detail |
|---|
public void assertConsistent()
public String getName()
ExoCache
getName in interface ExoCache<K extends Serializable,V>public void setName(String s)
ExoCache
setName in interface ExoCache<K extends Serializable,V>s - the cache namepublic String getLabel()
ExoCache
getLabel in interface ExoCache<K extends Serializable,V>public void setLabel(String name)
ExoCache
setLabel in interface ExoCache<K extends Serializable,V>name - the cache labelpublic long getLiveTime()
ExoCache
getLiveTime in interface ExoCache<K extends Serializable,V>public void setLiveTime(long period)
ExoCache
setLiveTime in interface ExoCache<K extends Serializable,V>period - the live timepublic long getLiveTimeMillis()
public void setLiveTimeMillis(long liveTimeMillis)
public int getMaxSize()
ExoCache
getMaxSize in interface ExoCache<K extends Serializable,V>public void setMaxSize(int max)
ExoCache
setMaxSize in interface ExoCache<K extends Serializable,V>max - the maximum capacitypublic V get(Serializable name)
ExoCache
get in interface ExoCache<K extends Serializable,V>name - the cache key
public void put(K name,
V obj)
ExoCache
put in interface ExoCache<K extends Serializable,V>name - the cache keyobj - the cached valuepublic void putMap(Map<? extends K,? extends V> objs)
ExoCache
putMap in interface ExoCache<K extends Serializable,V>objs - the objects to putpublic V remove(Serializable name)
ExoCache
remove in interface ExoCache<K extends Serializable,V>name - the cache key
public List<? extends V> getCachedObjects()
ExoCache
getCachedObjects in interface ExoCache<K extends Serializable,V>public List<? extends V> removeCachedObjects()
ExoCache
removeCachedObjects in interface ExoCache<K extends Serializable,V>public void clearCache()
ExoCache
clearCache in interface ExoCache<K extends Serializable,V>
public void select(CachedObjectSelector<? super K,? super V> selector)
throws Exception
ExoCache
select in interface ExoCache<K extends Serializable,V>selector - the selector
Exception - any exceptionpublic int getCacheSize()
ExoCache
getCacheSize in interface ExoCache<K extends Serializable,V>public int getCacheHit()
ExoCache
getCacheHit in interface ExoCache<K extends Serializable,V>public int getCacheMiss()
ExoCache
getCacheMiss in interface ExoCache<K extends Serializable,V>public void addCacheListener(CacheListener<? super K,? super V> listener)
ExoCache
addCacheListener in interface ExoCache<K extends Serializable,V>listener - the listener to addpublic boolean isLogEnabled()
isLogEnabled in interface ExoCache<K extends Serializable,V>public void setLogEnabled(boolean logEnabled)
setLogEnabled in interface ExoCache<K extends Serializable,V>
|
eXo Kernel :: Component :: Cache Service 2.4.8-GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||