K - the key typeV - the value typepublic interface LowerCachingTier<K,V> extends ConfigurationChangeSupport
CachingTier.| Modifier and Type | Interface and Description |
|---|---|
static interface |
LowerCachingTier.Provider
Service interface for providing LowerCachingTier instances. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Empty out this tier
|
Store.ValueHolder<V> |
get(K key)
Return the value holder currently in this tier.
|
Store.ValueHolder<V> |
getAndRemove(K key)
Return the value holder currently in this tier and removes it atomically.
|
Store.ValueHolder<V> |
installMapping(K key,
java.util.function.Function<K,Store.ValueHolder<V>> source)
Either return the
Store.ValueHolder currently in the caching tier
or installs and returns the result of the passed in function. |
void |
invalidate(K key)
Removes a mapping, triggering the
CachingTier.InvalidationListener if
registered. |
void |
invalidateAll()
Invalidates all mapping, invoking the
CachingTier.InvalidationListener if
registered. |
void |
invalidateAllWithHash(long hash)
Invalidates all mappings whose key's hash code matches the provided one, invoking the
CachingTier.InvalidationListener if registered. |
void |
setInvalidationListener(CachingTier.InvalidationListener<K,V> invalidationListener)
Set the caching tier's invalidation listener.
|
getConfigurationChangeListenersStore.ValueHolder<V> installMapping(K key, java.util.function.Function<K,Store.ValueHolder<V>> source) throws org.ehcache.spi.resilience.StoreAccessException
Store.ValueHolder currently in the caching tier
or installs and returns the result of the passed in function.
Note that in case of expired Store.ValueHolder null will be returned
and the mapping will be invalidated.
key - the keysource - the function that computes the valuenullorg.ehcache.spi.resilience.StoreAccessException - if the mapping cannot be accessed, installed or removedStore.ValueHolder<V> get(K key) throws org.ehcache.spi.resilience.StoreAccessException
key - the keynullorg.ehcache.spi.resilience.StoreAccessException - if the mapping cannot be accessStore.ValueHolder<V> getAndRemove(K key) throws org.ehcache.spi.resilience.StoreAccessException
key - the keynullorg.ehcache.spi.resilience.StoreAccessException - if the mapping cannot be access or removedvoid invalidate(K key) throws org.ehcache.spi.resilience.StoreAccessException
CachingTier.InvalidationListener if
registered.key - the key to removeorg.ehcache.spi.resilience.StoreAccessException - if the mapping cannot be removedvoid invalidateAll()
throws org.ehcache.spi.resilience.StoreAccessException
CachingTier.InvalidationListener if
registered.org.ehcache.spi.resilience.StoreAccessException - if mappings cannot be removedvoid invalidateAllWithHash(long hash)
throws org.ehcache.spi.resilience.StoreAccessException
CachingTier.InvalidationListener if registered.org.ehcache.spi.resilience.StoreAccessException - if mappings cannot be removedvoid clear()
throws org.ehcache.spi.resilience.StoreAccessException
org.ehcache.spi.resilience.StoreAccessException - if mappings cannot be removedvoid setInvalidationListener(CachingTier.InvalidationListener<K,V> invalidationListener)
invalidationListener - the listener