Class DistributedExoCache<K extends Serializable,V>
- java.lang.Object
-
- org.exoplatform.services.cache.impl.infinispan.distributed.DistributedExoCache<K,V>
-
- All Implemented Interfaces:
org.exoplatform.services.cache.ExoCache<K,V>
public class DistributedExoCache<K extends Serializable,V> extends Object implements org.exoplatform.services.cache.ExoCache<K,V>
- Version:
- $Id$
- Author:
- Nicolas Filotto
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDistributedExoCache.CacheEventListenerstatic classDistributedExoCache.CacheKey<K>static classDistributedExoCache.ClearCacheMapper<K,V>static classDistributedExoCache.ClearCacheReducerstatic classDistributedExoCache.GetCachedObjectsMapper<K,V>static classDistributedExoCache.GetCachedObjectsReducer<K,V>static classDistributedExoCache.GetEntriesMapper<K,V>static classDistributedExoCache.GetEntriesReducer<K,V>static classDistributedExoCache.GetSizeMapper<K,V>static classDistributedExoCache.GetSizeReducer<K>
-
Field Summary
Fields Modifier and Type Field Description protected org.infinispan.AdvancedCache<DistributedExoCache.CacheKey<K>,V>cachestatic StringCACHE_NAME
-
Constructor Summary
Constructors Constructor Description DistributedExoCache(org.exoplatform.container.ExoContainerContext ctx, org.exoplatform.services.cache.ExoCacheConfig config, org.infinispan.Cache<K,V> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCacheListener(org.exoplatform.services.cache.CacheListener<? super K,? super V> listener)voidclearCache()Vget(Serializable name)List<V>getCachedObjects()intgetCacheHit()intgetCacheMiss()intgetCacheSize()StringgetLabel()longgetLiveTime()longgetMaxIdle()intgetMaxSize()StringgetName()longgetWakeUpInterval()booleanisDistributed()booleanisLogEnabled()booleanisReplicated()voidonClearCache()voidonPut(K key, V obj)voidput(K key, V value)voidputMap(Map<? extends K,? extends V> objs)protected voidputOnly(K key, V value)Only puts the data into the cache nothing moreVremove(Serializable name)List<V>removeCachedObjects()voidselect(org.exoplatform.services.cache.CachedObjectSelector<? super K,? super V> selector)voidsetDistributed(boolean distributed)voidsetLabel(String label)voidsetLiveTime(long period)voidsetLogEnabled(boolean logEnabled)voidsetMaxSize(int max)voidsetName(String name)voidsetReplicated(boolean replicated)
-
-
-
Field Detail
-
CACHE_NAME
public static final String CACHE_NAME
- See Also:
- Constant Field Values
-
cache
protected final org.infinispan.AdvancedCache<DistributedExoCache.CacheKey<K extends Serializable>,V> cache
-
-
Method Detail
-
addCacheListener
public void addCacheListener(org.exoplatform.services.cache.CacheListener<? super K,? super V> listener)
- Specified by:
addCacheListenerin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
clearCache
public void clearCache()
- Specified by:
clearCachein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
get
public V get(Serializable name)
- Specified by:
getin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getCacheHit
public int getCacheHit()
- Specified by:
getCacheHitin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getCacheMiss
public int getCacheMiss()
- Specified by:
getCacheMissin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getCacheSize
public int getCacheSize()
- Specified by:
getCacheSizein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getCachedObjects
public List<V> getCachedObjects()
- Specified by:
getCachedObjectsin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getLabel
public String getLabel()
- Specified by:
getLabelin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getName
public String getName()
- Specified by:
getNamein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
isDistributed
public boolean isDistributed()
-
isLogEnabled
public boolean isLogEnabled()
- Specified by:
isLogEnabledin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
isReplicated
public boolean isReplicated()
-
put
public void put(K key, V value) throws IllegalArgumentException
- Specified by:
putin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>- Throws:
IllegalArgumentException
-
putMap
public void putMap(Map<? extends K,? extends V> objs) throws IllegalArgumentException
- Specified by:
putMapin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>- Throws:
IllegalArgumentException
-
remove
public V remove(Serializable name) throws IllegalArgumentException
- Specified by:
removein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>- Throws:
IllegalArgumentException
-
removeCachedObjects
public List<V> removeCachedObjects()
- Specified by:
removeCachedObjectsin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
select
public void select(org.exoplatform.services.cache.CachedObjectSelector<? super K,? super V> selector) throws Exception
- Specified by:
selectin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>- Throws:
Exception
-
setDistributed
public void setDistributed(boolean distributed)
-
setLabel
public void setLabel(String label)
- Specified by:
setLabelin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
setLogEnabled
public void setLogEnabled(boolean logEnabled)
- Specified by:
setLogEnabledin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
setReplicated
public void setReplicated(boolean replicated)
-
onPut
public void onPut(K key, V obj)
- Specified by:
onPutin interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
onClearCache
public void onClearCache()
- Specified by:
onClearCachein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
setMaxSize
public void setMaxSize(int max)
- Specified by:
setMaxSizein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
setLiveTime
public void setLiveTime(long period)
- Specified by:
setLiveTimein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getMaxSize
public int getMaxSize()
- Specified by:
getMaxSizein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getLiveTime
public long getLiveTime()
- Specified by:
getLiveTimein interfaceorg.exoplatform.services.cache.ExoCache<K extends Serializable,V>
-
getMaxIdle
public long getMaxIdle()
-
getWakeUpInterval
public long getWakeUpInterval()
-
-