Class LazyBasicCache<K,V,C extends org.infinispan.commons.api.BasicCache<K,V>>
- java.lang.Object
-
- org.jboss.as.clustering.infinispan.cache.LazyBasicCache<K,V,C>
-
- All Implemented Interfaces:
PrivilegedAction<C>,ConcurrentMap<K,V>,Supplier<C>,Map<K,V>,org.infinispan.commons.api.AsyncCache<K,V>,org.infinispan.commons.api.BasicCache<K,V>,org.infinispan.commons.api.Lifecycle
- Direct Known Subclasses:
LazyCache
public abstract class LazyBasicCache<K,V,C extends org.infinispan.commons.api.BasicCache<K,V>> extends Object implements org.infinispan.commons.api.BasicCache<K,V>, Supplier<C>, PrivilegedAction<C>
A cache that resolves itself from its cache container lazily.- Author:
- Paul Ferraro
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLazyBasicCache(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()CompletableFuture<Void>clearAsync()Vcompute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)Vcompute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)Vcompute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<V>computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)CompletableFuture<V>computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)CompletableFuture<V>computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)VcomputeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)VcomputeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)VcomputeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<V>computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction)CompletableFuture<V>computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)CompletableFuture<V>computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)VcomputeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)VcomputeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)VcomputeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<V>computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)CompletableFuture<V>computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)CompletableFuture<V>computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<K,V>>entrySet()Cget()Vget(Object key)CompletableFuture<V>getAsync(K key)StringgetName()StringgetVersion()booleanisEmpty()Set<K>keySet()Vmerge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)Vmerge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)Vmerge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<V>mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)CompletableFuture<V>mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)CompletableFuture<V>mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)Vput(K key, V value)Vput(K key, V value, long lifespan, TimeUnit lifespanUnit)Vput(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)voidputAll(Map<? extends K,? extends V> map)voidputAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit)voidputAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<Void>putAllAsync(Map<? extends K,? extends V> entries)CompletableFuture<Void>putAllAsync(Map<? extends K,? extends V> entries, long lifespan, TimeUnit lifespanUnit)CompletableFuture<Void>putAllAsync(Map<? extends K,? extends V> entries, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<V>putAsync(K key, V value)CompletableFuture<V>putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)CompletableFuture<V>putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)VputIfAbsent(K key, V value)VputIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit)VputIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<V>putIfAbsentAsync(K key, V value)CompletableFuture<V>putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)CompletableFuture<V>putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)Vremove(Object key)booleanremove(Object key, Object value)CompletableFuture<V>removeAsync(Object key)CompletableFuture<Boolean>removeAsync(Object key, Object value)Vreplace(K key, V value)Vreplace(K key, V value, long lifespan, TimeUnit lifespanUnit)Vreplace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)booleanreplace(K key, V oldValue, V newValue)booleanreplace(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit)booleanreplace(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<V>replaceAsync(K key, V value)CompletableFuture<V>replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)CompletableFuture<V>replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)CompletableFuture<Boolean>replaceAsync(K key, V oldValue, V newValue)CompletableFuture<Boolean>replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit)CompletableFuture<Boolean>replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)intsize()CompletableFuture<Long>sizeAsync()voidstart()voidstop()Collection<V>values()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.api.AsyncCache
containsKeyAsync, getAllAsync
-
Methods inherited from interface java.util.concurrent.ConcurrentMap
forEach, getOrDefault, replaceAll
-
Methods inherited from interface java.security.PrivilegedAction
run
-
-
-
-
Constructor Detail
-
LazyBasicCache
protected LazyBasicCache(String name)
-
-
Method Detail
-
getName
public String getName()
-
start
public void start()
- Specified by:
startin interfaceorg.infinispan.commons.api.Lifecycle
-
stop
public void stop()
- Specified by:
stopin interfaceorg.infinispan.commons.api.Lifecycle
-
getVersion
public String getVersion()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>
-
compute
public V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
-
compute
public V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
- Specified by:
computeIfAbsentin interfaceConcurrentMap<K,V>- Specified by:
computeIfAbsentin interfaceMap<K,V>
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
- Specified by:
computeIfPresentin interfaceConcurrentMap<K,V>- Specified by:
computeIfPresentin interfaceMap<K,V>
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
put
public V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
putAll
public void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
putIfAbsent
public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V>- Specified by:
putIfAbsentin interfaceMap<K,V>
-
putIfAbsent
public V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
replace
public V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
replace
public boolean replace(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit)
-
replace
public boolean replace(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
clearAsync
public CompletableFuture<Void> clearAsync()
-
computeAsync
public CompletableFuture<V> computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
-
computeAsync
public CompletableFuture<V> computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
-
computeAsync
public CompletableFuture<V> computeAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
computeIfAbsentAsync
public CompletableFuture<V> computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction)
-
computeIfAbsentAsync
public CompletableFuture<V> computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit)
-
computeIfAbsentAsync
public CompletableFuture<V> computeIfAbsentAsync(K key, Function<? super K,? extends V> mappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
computeIfPresentAsync
public CompletableFuture<V> computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
-
computeIfPresentAsync
public CompletableFuture<V> computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
-
computeIfPresentAsync
public CompletableFuture<V> computeIfPresentAsync(K key, BiFunction<? super K,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
getAsync
public CompletableFuture<V> getAsync(K key)
-
mergeAsync
public CompletableFuture<V> mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
-
mergeAsync
public CompletableFuture<V> mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit)
-
mergeAsync
public CompletableFuture<V> mergeAsync(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
putAsync
public CompletableFuture<V> putAsync(K key, V value)
-
putAsync
public CompletableFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)
-
putAsync
public CompletableFuture<V> putAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
putAllAsync
public CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> entries)
-
putAllAsync
public CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> entries, long lifespan, TimeUnit lifespanUnit)
-
putAllAsync
public CompletableFuture<Void> putAllAsync(Map<? extends K,? extends V> entries, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
putIfAbsentAsync
public CompletableFuture<V> putIfAbsentAsync(K key, V value)
-
putIfAbsentAsync
public CompletableFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)
-
putIfAbsentAsync
public CompletableFuture<V> putIfAbsentAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
removeAsync
public CompletableFuture<V> removeAsync(Object key)
-
removeAsync
public CompletableFuture<Boolean> removeAsync(Object key, Object value)
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value)
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit)
-
replaceAsync
public CompletableFuture<V> replaceAsync(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
replaceAsync
public CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue)
-
replaceAsync
public CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit)
-
replaceAsync
public CompletableFuture<Boolean> replaceAsync(K key, V oldValue, V newValue, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
-
sizeAsync
public CompletableFuture<Long> sizeAsync()
-
-