Package com.axelor.cache.redisson
Class RedissonLoadingCacheNative<K,V>
java.lang.Object
com.axelor.cache.redisson.AbstractRedissonCache<K,V,org.redisson.api.RMapCacheNative<K,V>>
com.axelor.cache.redisson.RedissonCacheNative<K,V>
com.axelor.cache.redisson.RedissonLoadingCacheNative<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 native eviction
This wraps a RMapCacheNative and computes values using the CacheLoader on cache misses.
-
Field Summary
Fields inherited from class com.axelor.cache.redisson.AbstractRedissonCache
cache -
Constructor Summary
ConstructorsConstructorDescriptionRedissonLoadingCacheNative(org.redisson.api.RMapCacheNative<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.RedissonCacheNative
get, put, putAll, setExpireAfterAccess, setExpireAfterWrite, setMaximumSizeMethods inherited from class com.axelor.cache.redisson.AbstractRedissonCache
asMap, clearExpire, close, 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
-
RedissonLoadingCacheNative
public RedissonLoadingCacheNative(org.redisson.api.RMapCacheNative<K, V> cache, CacheLoader<K, V> loader)
-
-
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.RMapCacheNative<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.RMapCacheNative<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
-