|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache
public class ConcurrentFIFOExoCache
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,
org.apache.commons.logging.Log log)
|
|
ConcurrentFIFOExoCache(org.apache.commons.logging.Log log)
|
|
ConcurrentFIFOExoCache(java.lang.String name,
int maxSize)
|
|
ConcurrentFIFOExoCache(java.lang.String name,
int maxSize,
org.apache.commons.logging.Log log)
|
|
| Method Summary | |
|---|---|
void |
addCacheListener(CacheListener listener)
|
void |
assertConsistent()
|
void |
clearCache()
Clears the cache. |
java.lang.Object |
get(java.io.Serializable name)
Performs a lookup operation. |
java.util.List |
getCachedObjects()
Returns a list of cached object that are considered as valid when the method is called. |
int |
getCacheHit()
|
int |
getCacheMiss()
|
int |
getCacheSize()
|
java.lang.String |
getLabel()
|
long |
getLiveTime()
|
long |
getLiveTimeMillis()
|
int |
getMaxSize()
|
java.lang.String |
getName()
|
boolean |
isDistributed()
|
boolean |
isLogEnabled()
|
boolean |
isReplicated()
|
void |
put(java.io.Serializable name,
java.lang.Object obj)
Performs a put in the cache. |
void |
putMap(java.util.Map<java.io.Serializable,java.lang.Object> objs)
Performs a put of all the entries provided by the map argument. |
java.lang.Object |
remove(java.io.Serializable name)
Removes an entry from the cache. |
java.util.List |
removeCachedObjects()
Clears the cache and returns the list of cached object that are considered as valid when the method is called. |
void |
select(CachedObjectSelector selector)
Selects a subset of the cache. |
void |
setDistributed(boolean distributed)
|
void |
setLabel(java.lang.String name)
|
void |
setLiveTime(long period)
|
void |
setLiveTimeMillis(long liveTimeMillis)
|
void |
setLogEnabled(boolean logEnabled)
|
void |
setMaxSize(int max)
|
void |
setName(java.lang.String s)
|
void |
setReplicated(boolean replicated)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConcurrentFIFOExoCache()
public ConcurrentFIFOExoCache(org.apache.commons.logging.Log log)
public ConcurrentFIFOExoCache(int maxSize)
public ConcurrentFIFOExoCache(int maxSize,
org.apache.commons.logging.Log log)
public ConcurrentFIFOExoCache(java.lang.String name,
int maxSize)
public ConcurrentFIFOExoCache(java.lang.String name,
int maxSize,
org.apache.commons.logging.Log log)
| Method Detail |
|---|
public void assertConsistent()
public java.lang.String getName()
getName in interface ExoCachepublic void setName(java.lang.String s)
setName in interface ExoCachepublic java.lang.String getLabel()
getLabel in interface ExoCachepublic void setLabel(java.lang.String name)
setLabel in interface ExoCachepublic long getLiveTime()
getLiveTime in interface ExoCachepublic void setLiveTime(long period)
setLiveTime in interface ExoCachepublic long getLiveTimeMillis()
public void setLiveTimeMillis(long liveTimeMillis)
public int getMaxSize()
getMaxSize in interface ExoCachepublic void setMaxSize(int max)
setMaxSize in interface ExoCachepublic java.lang.Object get(java.io.Serializable name)
ExoCache
get in interface ExoCachename - the cache key
public void put(java.io.Serializable name,
java.lang.Object obj)
ExoCache
put in interface ExoCachename - the cache keyobj - the cached valuepublic void putMap(java.util.Map<java.io.Serializable,java.lang.Object> objs)
ExoCache
putMap in interface ExoCacheobjs - the objects to putpublic java.lang.Object remove(java.io.Serializable name)
ExoCache
remove in interface ExoCachename - the cache key
public java.util.List getCachedObjects()
ExoCache
getCachedObjects in interface ExoCache
public java.util.List removeCachedObjects()
throws java.lang.Exception
ExoCache
removeCachedObjects in interface ExoCachejava.lang.Exception - any exception
public void clearCache()
throws java.lang.Exception
ExoCache
clearCache in interface ExoCachejava.lang.Exception - any exception
public void select(CachedObjectSelector selector)
throws java.lang.Exception
ExoCache
select in interface ExoCacheselector - the selector
java.lang.Exception - any exceptionpublic int getCacheSize()
getCacheSize in interface ExoCachepublic int getCacheHit()
getCacheHit in interface ExoCachepublic int getCacheMiss()
getCacheMiss in interface ExoCachepublic void addCacheListener(CacheListener listener)
addCacheListener in interface ExoCachepublic boolean isDistributed()
isDistributed in interface ExoCachepublic void setDistributed(boolean distributed)
setDistributed in interface ExoCachepublic boolean isReplicated()
isReplicated in interface ExoCachepublic void setReplicated(boolean replicated)
setReplicated in interface ExoCachepublic boolean isLogEnabled()
isLogEnabled in interface ExoCachepublic void setLogEnabled(boolean logEnabled)
setLogEnabled in interface ExoCache
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||