Class RedissonCache<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>
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 RedissonCache<K,V> extends AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
Redisson cache with scripted eviction

This wraps a RMapCache.

  • Constructor Details

    • RedissonCache

      public RedissonCache(org.redisson.api.RMapCache<K,V> cache)
  • Method Details

    • setExpireAfterWrite

      public void setExpireAfterWrite(Duration expireAfterWrite)
      Specified by:
      setExpireAfterWrite in class AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
    • setExpireAfterAccess

      public void setExpireAfterAccess(Duration expireAfterAccess)
      Specified by:
      setExpireAfterAccess in class AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
    • setMaximumSize

      public void setMaximumSize(int maximumSize)
      Specified by:
      setMaximumSize in class AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
    • put

      public void put(K key, V value)
      Description copied from interface: AxelorCache
      Associates the value with the key.
      Specified by:
      put in interface AxelorCache<K,V>
      Overrides:
      put in class AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
      Parameters:
      key - key with which the specified value is to be associated
      value - value to be associated with the specified key
    • putAll

      public void putAll(Map<? extends K,? extends V> map)
      Description copied from interface: AxelorCache
      Copies all of the mappings from the specified map to the cache.

      The effect of this call is equivalent to that of calling put(key, value) on this map once for each mapping from key to value in the specified map.

      Specified by:
      putAll in interface AxelorCache<K,V>
      Overrides:
      putAll in class AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
      Parameters:
      map - the mappings to be stored in this cache
    • close

      public void close()
      Description copied from interface: AxelorCache
      Signals that the cache is no longer in use and releases any resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface AxelorCache<K,V>
      Specified by:
      close in interface Closeable
      Overrides:
      close in class AbstractRedissonCache<K,V,org.redisson.api.RMapCache<K,V>>
    • addListener

      public int addListener(org.redisson.api.map.event.MapEntryListener listener)
    • removeListener

      public void removeListener(int listenerId)