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 cache
V - the type of mapped values
All Implemented Interfaces:
AxelorCache<K,V>, Closeable, AutoCloseable, Iterable<Map.Entry<K,V>>

public class RedissonLoadingCacheNative<K,V> extends RedissonCacheNative<K,V>
Redisson loading cache with native eviction

This wraps a RMapCacheNative and computes values using the CacheLoader on cache misses.

  • Constructor Details

    • RedissonLoadingCacheNative

      public RedissonLoadingCacheNative(org.redisson.api.RMapCacheNative<K,V> cache, CacheLoader<K,V> loader)
  • Method Details

    • get

      public V get(K key)
      Description copied from interface: AxelorCache
      Returns the value associated with the key in this cache, obtaining that value from the CacheLoader if defined and if necessary, otherwise returns null if there is no cached value for the key.
      Specified by:
      get in interface AxelorCache<K,V>
      Overrides:
      get in class AbstractRedissonCache<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 null if this map contains no mapping for the key
    • getAll

      public Map<K,V> getAll(Set<K> keys)
      Description copied from interface: AxelorCache
      Returns a map of the values associated with the keys in this cache, using CacheLoader if defined and if necessary.
      Specified by:
      getAll in interface AxelorCache<K,V>
      Overrides:
      getAll in class AbstractRedissonCache<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