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 |
merge(K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction) |
V |
merge(K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction,
long lifespan,
TimeUnit lifespanUnit)
An overloaded form of
ConcurrentMap.merge(Object, Object, BiFunction) which takes in lifespan parameters. |
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. |
CompletableFuture<Void> |
putAllAsync(Map<? extends K,? extends V> data)
Asynchronous version of
Map.putAll(Map). |
CompletableFuture<Void> |
putAllAsync(Map<? extends K,? extends V> data,
long lifespan,
TimeUnit unit)
Asynchronous version of
BasicCache.putAll(Map, long, TimeUnit). |
CompletableFuture<V> |
putAsync(K key,
V value)
Asynchronous version of
BasicCache.put(Object, Object). |
CompletableFuture<V> |
putAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
BasicCache.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. |
CompletableFuture<V> |
putIfAbsentAsync(K key,
V value)
Asynchronous version of
ConcurrentMap.putIfAbsent(Object, Object). |
CompletableFuture<V> |
putIfAbsentAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
BasicCache.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. |
CompletableFuture<V> |
replaceAsync(K key,
V value)
Asynchronous version of
ConcurrentMap.replace(Object, Object). |
CompletableFuture<V> |
replaceAsync(K key,
V value,
long lifespan,
TimeUnit unit)
Asynchronous version of
BasicCache.replace(Object, Object, long, TimeUnit). |
CompletableFuture<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue)
Asynchronous version of
ConcurrentMap.replace(Object, Object, Object). |
CompletableFuture<Boolean> |
replaceAsync(K key,
V oldValue,
V newValue,
long lifespan,
TimeUnit unit)
Asynchronous version of
BasicCache.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, waitcompute, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, computeIfPresent, getName, getVersion, merge, put, putAll, putIfAbsent, remove, replace, replaceclearAsync, computeAsync, computeAsync, computeAsync, computeIfAbsentAsync, computeIfAbsentAsync, computeIfAbsentAsync, computeIfPresentAsync, computeIfPresentAsync, computeIfPresentAsync, containsKeyAsync, getAllAsync, getAsync, mergeAsync, mergeAsync, mergeAsync, putAllAsync, putAsync, putIfAbsentAsync, removeAsync, removeAsync, replaceAsync, replaceAsync, sizeAsynccompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, 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 CompletableFuture<V> putAsync(K key, V value)
AsyncCacheBasicCache.put(Object, Object). This method does not block on remote calls, even if your
cache mode is synchronous.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 CompletableFuture<V> putAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCacheBasicCache.put(Object, Object, long, TimeUnit) . This method does not block on remote
calls, even if your cache mode is synchronous.putAsync in interface AsyncCache<K,V>key - key to usevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic final CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> data)
AsyncCacheMap.putAll(Map). This method does not block on remote calls, even if your cache mode
is synchronous.putAllAsync in interface AsyncCache<K,V>data - to storepublic final CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> data, long lifespan, TimeUnit unit)
AsyncCacheBasicCache.putAll(Map, long, TimeUnit). This method does not block on remote calls, even if
your cache mode is synchronous.putAllAsync in interface AsyncCache<K,V>data - to storelifespan - lifespan of entryunit - time unit for lifespanpublic final CompletableFuture<V> putIfAbsentAsync(K key, V value)
AsyncCacheConcurrentMap.putIfAbsent(Object, Object). This method does not block on remote calls, even if
your cache mode is synchronous.putIfAbsentAsync in interface AsyncCache<K,V>key - key to usevalue - value to storepublic final CompletableFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCacheBasicCache.putIfAbsent(Object, Object, long, TimeUnit) . This method does not block on
remote calls, even if your cache mode is synchronous.putIfAbsentAsync in interface AsyncCache<K,V>key - key to usevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic final CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit unit)
AsyncCacheBasicCache.replace(Object, Object, long, TimeUnit). This method does not block on remote
calls, even if your cache mode is synchronous.replaceAsync in interface AsyncCache<K,V>key - key to removevalue - value to storelifespan - lifespan of entryunit - time unit for lifespanpublic final CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue)
AsyncCacheConcurrentMap.replace(Object, Object, Object). This method does not block on remote calls,
even if your cache mode is synchronous.replaceAsync in interface AsyncCache<K,V>key - key to removeoldValue - value to overwritenewValue - value to storepublic final CompletableFuture<V> replaceAsync(K key, V value)
AsyncCacheConcurrentMap.replace(Object, Object). This method does not block on remote calls, even if
your cache mode is synchronous.replaceAsync in interface AsyncCache<K,V>key - key to removevalue - value to storepublic final CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit unit)
AsyncCacheBasicCache.replace(Object, Object, Object, long, TimeUnit). This method does not block on
remote calls, even if your cache mode is synchronous.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 lifespanpublic final V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
public final V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
BasicCacheConcurrentMap.merge(Object, Object, BiFunction) which takes in lifespan parameters.merge in interface BasicCache<K,V>key - key to usevalue - new value to merge with existing valueremappingFunction - function to use to merge new and existing values into a merged value to store under keylifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.lifespanUnit - time unit for lifespanCopyright © 2021 JBoss by Red Hat. All rights reserved.