eXo Kernel :: Cache Extension :: JBoss Cache Implementation 2.4.0-CR2

org.exoplatform.services.cache.impl.jboss
Class AbstractExoCache<K extends Serializable,V>

java.lang.Object
  extended by org.exoplatform.services.cache.impl.jboss.AbstractExoCache<K,V>
All Implemented Interfaces:
ExoCache<K,V>
Direct Known Subclasses:
EAExoCacheCreator.EAExoCache, FIFOExoCacheCreator.FIFOExoCache, LFUExoCacheCreator.LFUExoCache, LRUExoCacheCreator.LRUExoCache, MRUExoCacheCreator.MRUExoCache

public abstract class AbstractExoCache<K extends Serializable,V>
extends Object
implements ExoCache<K,V>

An ExoCache implementation based on Node. Created by The eXo Platform SAS Author : eXoPlatform exo@exoplatform.com 20 juil. 2009


Nested Class Summary
 class AbstractExoCache.CacheEventListener
           
 
Field Summary
protected  org.jboss.cache.CacheSPI<K,V> cache
           
protected  org.jboss.cache.Fqn<String> rootFqn
           
 
Constructor Summary
AbstractExoCache(ExoCacheConfig config, org.jboss.cache.Cache<K,V> cache, org.jboss.cache.Fqn<String> rootFqn)
           
 
Method Summary
 void addCacheListener(CacheListener<? super K,? super V> listener)
          
 void clearCache()
          
 V get(Serializable name)
          
 List<V> getCachedObjects()
          
 int getCacheHit()
          
 int getCacheMiss()
          
 int getCacheSize()
          
protected  org.jboss.cache.Fqn<Serializable> getFqn(Serializable name)
          Returns the Fqn related to the given name
 String getLabel()
          
 String getName()
          
 boolean isDistributed()
          
 boolean isLogEnabled()
          
 boolean isReplicated()
          
 void put(K key, V value)
          
 void putMap(Map<? extends K,? extends V> objs)
          
protected  V putOnly(K key, V value)
          Only puts the data into the cache nothing more
 V remove(Serializable name)
          
 List<V> removeCachedObjects()
          
 void select(CachedObjectSelector<? super K,? super V> selector)
          
 void setDistributed(boolean distributed)
          
 void setLabel(String label)
          
 void setLogEnabled(boolean logEnabled)
          
 void setName(String name)
          
 void setReplicated(boolean replicated)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exoplatform.services.cache.ExoCache
getLiveTime, getMaxSize, setLiveTime, setMaxSize
 

Field Detail

cache

protected final org.jboss.cache.CacheSPI<K extends Serializable,V> cache

rootFqn

protected final org.jboss.cache.Fqn<String> rootFqn
Constructor Detail

AbstractExoCache

public AbstractExoCache(ExoCacheConfig config,
                        org.jboss.cache.Cache<K,V> cache,
                        org.jboss.cache.Fqn<String> rootFqn)
Method Detail

addCacheListener

public void addCacheListener(CacheListener<? super K,? super V> listener)

Specified by:
addCacheListener in interface ExoCache<K extends Serializable,V>

clearCache

public void clearCache()

Specified by:
clearCache in interface ExoCache<K extends Serializable,V>

get

public V get(Serializable name)

Specified by:
get in interface ExoCache<K extends Serializable,V>

getCacheHit

public int getCacheHit()

Specified by:
getCacheHit in interface ExoCache<K extends Serializable,V>

getCacheMiss

public int getCacheMiss()

Specified by:
getCacheMiss in interface ExoCache<K extends Serializable,V>

getCacheSize

public int getCacheSize()

Specified by:
getCacheSize in interface ExoCache<K extends Serializable,V>

getCachedObjects

public List<V> getCachedObjects()

Specified by:
getCachedObjects in interface ExoCache<K extends Serializable,V>

getLabel

public String getLabel()

Specified by:
getLabel in interface ExoCache<K extends Serializable,V>

getName

public String getName()

Specified by:
getName in interface ExoCache<K extends Serializable,V>

isDistributed

public boolean isDistributed()


isLogEnabled

public boolean isLogEnabled()

Specified by:
isLogEnabled in interface ExoCache<K extends Serializable,V>

isReplicated

public boolean isReplicated()


put

public void put(K key,
                V value)
         throws IllegalArgumentException

Specified by:
put in interface ExoCache<K extends Serializable,V>
Throws:
IllegalArgumentException

putOnly

protected V putOnly(K key,
                    V value)
Only puts the data into the cache nothing more


putMap

public void putMap(Map<? extends K,? extends V> objs)
            throws IllegalArgumentException

Specified by:
putMap in interface ExoCache<K extends Serializable,V>
Throws:
IllegalArgumentException

remove

public V remove(Serializable name)
         throws IllegalArgumentException

Specified by:
remove in interface ExoCache<K extends Serializable,V>
Throws:
IllegalArgumentException

removeCachedObjects

public List<V> removeCachedObjects()

Specified by:
removeCachedObjects in interface ExoCache<K extends Serializable,V>

select

public void select(CachedObjectSelector<? super K,? super V> selector)
            throws Exception

Specified by:
select in interface ExoCache<K extends Serializable,V>
Throws:
Exception

setDistributed

public void setDistributed(boolean distributed)


setLabel

public void setLabel(String label)

Specified by:
setLabel in interface ExoCache<K extends Serializable,V>

setLogEnabled

public void setLogEnabled(boolean logEnabled)

Specified by:
setLogEnabled in interface ExoCache<K extends Serializable,V>

setName

public void setName(String name)

Specified by:
setName in interface ExoCache<K extends Serializable,V>

setReplicated

public void setReplicated(boolean replicated)


getFqn

protected org.jboss.cache.Fqn<Serializable> getFqn(Serializable name)
Returns the Fqn related to the given name


eXo Kernel :: Cache Extension :: JBoss Cache Implementation 2.4.0-CR2

Copyright © 2012 eXo Platform SAS. All Rights Reserved.