Package com.axelor.cache.redisson
Class RedissonLoadingCache<K,V>
java.lang.Object
com.axelor.cache.redisson.AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
com.axelor.cache.redisson.RedissonCache<K,V>
com.axelor.cache.redisson.RedissonLoadingCache<K,V>
- Type Parameters:
K- the type of keys maintained by this cacheV- the type of mapped values
- All Implemented Interfaces:
AxelorCache<K,,V> Closeable,AutoCloseable,Iterable<Map.Entry<K,V>>
Redisson loading cache with scripted eviction
This wraps a RMapCache and computes values using the CacheLoader on cache misses.
-
Field Summary
Fields inherited from class com.axelor.cache.redisson.AbstractRedissonCache
cache -
Constructor Summary
ConstructorsConstructorDescriptionRedissonLoadingCache(org.redisson.api.RMapCache<K, V> cache, CacheLoader<K, V> loader) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value associated with thekeyin this cache, obtaining that value from theCacheLoaderif defined and if necessary, otherwise returnsnullif there is no cached value for thekey.Returns a map of the values associated with thekeysin this cache, usingCacheLoaderif defined and if necessary.Methods inherited from class com.axelor.cache.redisson.RedissonCache
addListener, close, computeIfAbsent, get, put, putAll, removeListener, setExpireAfterAccess, setExpireAfterWrite, setMaximumSizeMethods inherited from class com.axelor.cache.redisson.AbstractRedissonCache
asMap, clearExpire, estimatedSize, expire, getLock, invalidate, invalidateAll, remainTimeToLiveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axelor.cache.AxelorCache
cleanUp, iteratorMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RedissonLoadingCache
-
-
Method Details
-
get
Description copied from interface:AxelorCacheReturns the value associated with thekeyin this cache, obtaining that value from theCacheLoaderif defined and if necessary, otherwise returnsnullif there is no cached value for thekey.- Specified by:
getin interfaceAxelorCache<K,V> - Overrides:
getin classAbstractRedissonCache<K,V, org.redisson.api.RMapCache<K, V>> - Parameters:
key- the key whose associated value is to be returned- Returns:
- the value to which the specified key is mapped, or
nullif this map contains no mapping for the key
-
getAll
Description copied from interface:AxelorCacheReturns a map of the values associated with thekeysin this cache, usingCacheLoaderif defined and if necessary.- Specified by:
getAllin interfaceAxelorCache<K,V> - Overrides:
getAllin classAbstractRedissonCache<K,V, org.redisson.api.RMapCache<K, V>> - Parameters:
keys- the keys whose associated values are to be returned- Returns:
- an unmodifiable mapping of keys to values for the specified keys in this cache
-