Package com.axelor.cache.redisson
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 cacheV
- the type of mapped values
- All Implemented Interfaces:
AxelorCache<K,
,V> Closeable
,AutoCloseable
,Iterable<Map.Entry<K,
V>>
Redisson cache with scripted eviction
This wraps a RMapCache
.
-
Field Summary
Fields inherited from class com.axelor.cache.redisson.AbstractRedissonCache
cache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
addListener
(org.redisson.api.map.event.MapEntryListener listener) void
close()
Signals that the cache is no longer in use and releases any resources.void
Associates thevalue
with thekey
.void
removeListener
(int listenerId) void
setExpireAfterAccess
(Duration expireAfterAccess) void
setExpireAfterWrite
(Duration expireAfterWrite) void
setMaximumSize
(int maximumSize) protected void
Methods inherited from class com.axelor.cache.redisson.AbstractRedissonCache
asMap, estimatedSize, get, getAll, getLock, invalidate, invalidateAll, putAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.axelor.cache.AxelorCache
cleanUp, get, iterator
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RedissonCache
-
-
Method Details
-
updatePutter
protected void updatePutter() -
setExpireAfterWrite
- Specified by:
setExpireAfterWrite
in classAbstractRedissonCache<K,
V, org.redisson.api.RMapCache<K, V>>
-
setExpireAfterAccess
- Specified by:
setExpireAfterAccess
in classAbstractRedissonCache<K,
V, org.redisson.api.RMapCache<K, V>>
-
setMaximumSize
public void setMaximumSize(int maximumSize) - Specified by:
setMaximumSize
in classAbstractRedissonCache<K,
V, org.redisson.api.RMapCache<K, V>>
-
put
Description copied from interface:AxelorCache
Associates thevalue
with thekey
.- Specified by:
put
in interfaceAxelorCache<K,
V> - Overrides:
put
in classAbstractRedissonCache<K,
V, org.redisson.api.RMapCache<K, V>> - Parameters:
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key
-
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 interfaceAutoCloseable
- Specified by:
close
in interfaceAxelorCache<K,
V> - Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractRedissonCache<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)
-