public class RefreshCache<K,V> extends LoadingCache<K,V>
| 构造器和说明 |
|---|
RefreshCache(Cache cache) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Clean resources created by this cache.
|
V |
computeIfAbsent(K key,
Function<K,V> loader)
If there is a value associated with the key, return the value;
otherwise use the loader load the value and return, and then update the cache.
|
V |
computeIfAbsent(K key,
Function<K,V> loader,
boolean cacheNullWhenLoaderReturnNull)
If there is a value associated with the key, return the value;
otherwise use the loader load the value and return, and then update the cache.
|
V |
computeIfAbsent(K key,
Function<K,V> loader,
boolean cacheNullWhenLoaderReturnNull,
long expireAfterWrite,
TimeUnit timeUnit)
If there is a value associated with the key, return the value;
otherwise use the loader load the value and return, and then update the cache.
|
MultiGetResult<K,V> |
GET_ALL(Set<? extends K> keys)
Gets a collection of entries from the Cache.
|
CacheGetResult<V> |
GET(K key)
Gets an entry from the cache.
|
get, getAllconfig, getTargetCache, PUT_ALL, PUT_ALL, PUT_IF_ABSENT, put, PUT, put, PUT, putAll, putAll, putIfAbsent, REMOVE_ALL, remove, REMOVE, removeAll, tryLock, tryLockAndRun, unwrappublic RefreshCache(Cache cache)
public void close()
Cachepublic V computeIfAbsent(K key, Function<K,V> loader)
CachecomputeIfAbsent 在接口中 Cache<K,V>computeIfAbsent 在类中 SimpleProxyCache<K,V>key - the keyloader - the value loaderCacheConfig.isCacheNullValue()public V computeIfAbsent(K key, Function<K,V> loader, boolean cacheNullWhenLoaderReturnNull)
CachecomputeIfAbsent 在接口中 Cache<K,V>computeIfAbsent 在类中 SimpleProxyCache<K,V>key - the keyloader - the value loadercacheNullWhenLoaderReturnNull - true if null value returned by loader should put into cache use the keypublic V computeIfAbsent(K key, Function<K,V> loader, boolean cacheNullWhenLoaderReturnNull, long expireAfterWrite, TimeUnit timeUnit)
CachecomputeIfAbsent 在接口中 Cache<K,V>computeIfAbsent 在类中 SimpleProxyCache<K,V>key - the keyloader - the value loadercacheNullWhenLoaderReturnNull - true if null value returned by loader should put into cache use the keyexpireAfterWrite - the TTL(time to live) of the KV associationtimeUnit - the time unit of expireAfterWritepublic CacheGetResult<V> GET(K key)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage()/getValue() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
public MultiGetResult<K,V> GET_ALL(Set<? extends K> keys)
Cacheif the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage()/getValue() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
Copyright © 2013–2019. All rights reserved.