public abstract class CacheSupport<K,V> extends Object implements BasicCache<K,V>
| Modifier and Type | Field and Description |
|---|---|
protected long |
defaultLifespan |
protected long |
defaultMaxIdleTime |
| Modifier | Constructor and Description |
|---|---|
protected |
CacheSupport() |
protected |
CacheSupport(long defaultLifespan,
long defaultMaxIdleTime) |
| Modifier and Type | Method and Description |
|---|---|
V |
put(K key,
V value)
If the return value of this operation will be ignored by the application,
the user is strongly encouraged to use the
Flag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently
as possible (i.e. |
V |
put(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
BasicCache.put(Object, Object), which takes in lifespan parameters. |
void |
putAll(Map<? extends K,? extends V> map) |
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit unit)
An overloaded form of
Map.putAll(Map), which takes in lifespan parameters. |
NotifyingFuture<Void> |
putAllAsync(Map<? extends K,? extends V> data)
Asynchronous version of
#putAll(Map). |
NotifyingFuture<Void> |
putAllAsync(Map<? extends K,? extends V> data,
long lifespan,
TimeUnit unit)
Asynchronous version of
#putAll(Map, long, TimeUnit). |
NotifyingFuture<V> |
putAsync(K key,
V value)
Asynchronous version of
#put(Object, Object). |
NotifyingFuture<V> |
putAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
#put(Object, Object, long, TimeUnit) . |
V |
putIfAbsent(K key,
V value) |
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
ConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters. |
NotifyingFuture<V> |
putIfAbsentAsync(K key,
V value)
Asynchronous version of
#putIfAbsent(Object, Object). |
NotifyingFuture<V> |
putIfAbsentAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
#putIfAbsent(Object, Object, long, TimeUnit) . |
V |
replace(K key,
V value) |
V |
replace(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
ConcurrentMap.replace(Object, Object), which takes in lifespan parameters. |
boolean |
replace(K key,
V oldValue,
V newValue) |
boolean |
replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of
ConcurrentMap.replace(Object, Object, Object), which takes in lifespan parameters. |
NotifyingFuture<V> |
replaceAsync(K key,
V value)
Asynchronous version of
#replace(Object, Object). |
NotifyingFuture<V> |
replaceAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
#replace(Object, Object, long, TimeUnit). |
NotifyingFuture<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue)
Asynchronous version of
#replace(Object, Object, Object). |
NotifyingFuture<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue,
long lifespan,
TimeUnit unit)
Asynchronous version of
#replace(Object, Object, Object, long, TimeUnit). |
protected abstract void |
set(K key,
V value)
This is intentionally a non-public method meant as an integration point for bytecode manipulation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, getVersion, put, putAll, putIfAbsent, remove, replace, replaceclearAsync, getAsync, putAllAsync, putAsync, putIfAbsentAsync, removeAsync, removeAsync, replaceAsync, replaceAsynccompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, remove, replaceAllprotected long defaultLifespan
protected long defaultMaxIdleTime
protected CacheSupport()
protected CacheSupport(long defaultLifespan,
long defaultMaxIdleTime)
public final V put(K key, V value)
BasicCacheFlag.IGNORE_RETURN_VALUES
flag when invoking this method in order to make it behave as efficiently
as possible (i.e. avoiding needless remote or network calls).protected abstract void set(K key, V value)
public final NotifyingFuture<V> putAsync(K key, V value)
AsyncCache#put(Object, Object). This method does not block on remote calls, even if your
cache mode is synchronous. Has no benefit over #put(Object, Object) if used in LOCAL mode.
putAsync in interface AsyncCache<K,V>key - key to usevalue - value to storepublic final V putIfAbsent(K key, V value)
putIfAbsent in interface ConcurrentMap<K,V>putIfAbsent in interface Map<K,V>public final NotifyingFuture<V> putAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCache#put(Object, Object, long, TimeUnit) . This method does not block on remote
calls, even if your cache mode is synchronous. Has no benefit over #put(Object, Object, long, TimeUnit)
if used in LOCAL mode.putAsync in interface AsyncCache<K,V>key - key to usevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic final NotifyingFuture<Void> putAllAsync(Map<? extends K,? extends V> data)
AsyncCache#putAll(Map). This method does not block on remote calls, even if your cache mode
is synchronous. Has no benefit over #putAll(Map) if used in LOCAL mode.putAllAsync in interface AsyncCache<K,V>data - to storepublic final NotifyingFuture<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit unit)
AsyncCache#putAll(Map, long, TimeUnit). This method does not block on remote calls, even if
your cache mode is synchronous. Has no benefit over #putAll(Map, long, TimeUnit) if used in LOCAL mode.putAllAsync in interface AsyncCache<K,V>data - to storelifespan - lifespan of entryunit - time unit for lifespanpublic final NotifyingFuture<V> putIfAbsentAsync(K key, V value)
AsyncCache#putIfAbsent(Object, Object). This method does not block on remote calls, even if
your cache mode is synchronous. Has no benefit over #putIfAbsent(Object, Object) if used in LOCAL mode.
putIfAbsentAsync in interface AsyncCache<K,V>key - key to usevalue - value to storepublic final NotifyingFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCache#putIfAbsent(Object, Object, long, TimeUnit) . This method does not block on
remote calls, even if your cache mode is synchronous. Has no benefit over #putIfAbsent(Object, Object,
long, TimeUnit) if used in LOCAL mode.putIfAbsentAsync in interface AsyncCache<K,V>key - key to usevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic final NotifyingFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCache#replace(Object, Object, long, TimeUnit). This method does not block on remote
calls, even if your cache mode is synchronous. Has no benefit over #replace(Object, Object, long,
TimeUnit) if used in LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic final NotifyingFuture<Boolean> replaceAsync(K key, V oldValue, V newValue)
AsyncCache#replace(Object, Object, Object). This method does not block on remote calls,
even if your cache mode is synchronous. Has no benefit over #replace(Object, Object, Object) if used in
LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removeoldValue - value to overwritenewValue - value to storepublic final NotifyingFuture<V> replaceAsync(K key, V value)
AsyncCache#replace(Object, Object). This method does not block on remote calls, even if
your cache mode is synchronous. Has no benefit over #replace(Object, Object) if used in LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removevalue - value to storepublic final NotifyingFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit unit)
AsyncCache#replace(Object, Object, Object, long, TimeUnit). This method does not block on
remote calls, even if your cache mode is synchronous. Has no benefit over #replace(Object, Object, Object,
long, TimeUnit) if used in LOCAL mode.replaceAsync in interface AsyncCache<K,V>key - key to removeoldValue - value to overwritenewValue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic final V put(K key, V value, long lifespan, TimeUnit unit)
BasicCacheBasicCache.put(Object, Object), which takes in lifespan parameters.put in interface BasicCache<K,V>key - key to usevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic final V putIfAbsent(K key, V value, long lifespan, TimeUnit unit)
BasicCacheConcurrentMap.putIfAbsent(Object, Object), which takes in lifespan parameters.putIfAbsent in interface BasicCache<K,V>key - key to usevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic final void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit unit)
BasicCacheMap.putAll(Map), which takes in lifespan parameters. Note that the lifespan is applied
to all mappings in the map passed in.putAll in interface BasicCache<K,V>map - map containing mappings to enterlifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic final V replace(K key, V value, long lifespan, TimeUnit unit)
BasicCacheConcurrentMap.replace(Object, Object), which takes in lifespan parameters.replace in interface BasicCache<K,V>key - key to usevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic final boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit unit)
BasicCacheConcurrentMap.replace(Object, Object, Object), which takes in lifespan parameters.replace in interface BasicCache<K,V>key - key to useoldValue - value to replacevalue - value to storelifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanCopyright © 2024 JBoss, a division of Red Hat. All rights reserved.