org.ehcache.internal.store.tiering
Class CompoundCachingTier<K,V>

java.lang.Object
  extended by org.ehcache.internal.store.tiering.CompoundCachingTier<K,V>
All Implemented Interfaces:
ConfigurationChangeSupport, CachingTier<K,V>

public class CompoundCachingTier<K,V>
extends java.lang.Object
implements CachingTier<K,V>


Nested Class Summary
static class CompoundCachingTier.Provider
           
 
Nested classes/interfaces inherited from interface org.ehcache.spi.cache.tiering.CachingTier
CachingTier.InvalidationListener<K,V>
 
Constructor Summary
CompoundCachingTier(HigherCachingTier<K,V> higher, LowerCachingTier<K,V> lower)
           
 
Method Summary
 void clear()
          Empty out the caching store.
 java.util.List<CacheConfigurationChangeListener> getConfigurationChangeListeners()
          get the List CacheConfigurationChangeListener defined in the Store
 Store.ValueHolder<V> getOrComputeIfAbsent(K key, Function<K,Store.ValueHolder<V>> source)
          Either return the value holder currently in the caching tier, or compute and store it when it isn't present.
 void invalidate(K key)
          Remove a mapping.
 void setInvalidationListener(CachingTier.InvalidationListener<K,V> invalidationListener)
          Set the caching tier's invalidation listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundCachingTier

public CompoundCachingTier(HigherCachingTier<K,V> higher,
                           LowerCachingTier<K,V> lower)
Method Detail

getOrComputeIfAbsent

public Store.ValueHolder<V> getOrComputeIfAbsent(K key,
                                                 Function<K,Store.ValueHolder<V>> source)
                                          throws CacheAccessException
Description copied from interface: CachingTier
Either return the value holder currently in the caching tier, or compute and store it when it isn't present. Note that in case of expired value holders null will be returned and the mapping will be invalidated.

Specified by:
getOrComputeIfAbsent in interface CachingTier<K,V>
Parameters:
key - the key.
source - the function that computes the value.
Returns:
the value holder, or null.
Throws:
CacheAccessException

invalidate

public void invalidate(K key)
                throws CacheAccessException
Description copied from interface: CachingTier
Remove a mapping.

Specified by:
invalidate in interface CachingTier<K,V>
Parameters:
key - the key.
Throws:
CacheAccessException

clear

public void clear()
           throws CacheAccessException
Description copied from interface: CachingTier
Empty out the caching store.

Specified by:
clear in interface CachingTier<K,V>
Throws:
CacheAccessException

setInvalidationListener

public void setInvalidationListener(CachingTier.InvalidationListener<K,V> invalidationListener)
Description copied from interface: CachingTier
Set the caching tier's invalidation listener. The invalidation listener can only be set once.

Specified by:
setInvalidationListener in interface CachingTier<K,V>
Parameters:
invalidationListener - the listener.

getConfigurationChangeListeners

public java.util.List<CacheConfigurationChangeListener> getConfigurationChangeListeners()
Description copied from interface: ConfigurationChangeSupport
get the List CacheConfigurationChangeListener defined in the Store

Specified by:
getConfigurationChangeListeners in interface ConfigurationChangeSupport
Returns:
a list of CacheConfigurationChangeListener