类 MultiLevelCache<K,V>
- 所有已实现的接口:
Cache<K,
,V> Closeable
,AutoCloseable
- 作者:
- huangli
-
构造器概要
构造器构造器说明MultiLevelCache
(Cache... caches) 已过时。MultiLevelCache
(MultiLevelCacheConfig<K, V> cacheConfig) -
方法概要
修饰符和类型方法说明Cache[]
caches()
void
close()
Clean resources created by this cache.config()
Get the config of this cache.Associates the specified value with the specified key in the cache.Copies all of the entries from the specified map to the cache.boolean
putIfAbsent
(K key, V value) Atomically associates the specified key with the given value if it is not already associated with a value.Use this cache attempt to acquire a exclusive lock specified by the key, this method will not block.<T> T
Provides a standard way to access the underlying concrete cache entry implementation in order to provide access to further, proprietary features.从类继承的方法 com.alicp.jetcache.AbstractCache
computeIfAbsent, computeIfAbsent, GET, GET_ALL, isClosed, notify, PUT, PUT_ALL, PUT_IF_ABSENT, REMOVE, REMOVE_ALL
-
构造器详细资料
-
MultiLevelCache
已过时。 -
MultiLevelCache
-
-
方法详细资料
-
caches
-
config
从接口复制的说明:Cache
Get the config of this cache.- 返回:
- the cache config
-
PUT
从接口复制的说明:Cache
Associates the specified value with the specified key in the cache.if the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
- 参数:
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key- 返回:
- the result
-
PUT_ALL
从接口复制的说明:Cache
Copies all of the entries from the specified map to the cache.if the implementation supports asynchronous operation, the cache access may not completed after this method return. The invoke of getResultCode()/isSuccess()/getMessage() on the result will block until cache operation is completed. Call future() method on the result will get a CompletionStage instance for asynchronous programming.
- 参数:
map
- mappings to be stored in this cache.- 返回:
- the result
-
unwrap
从接口复制的说明:Cache
Provides a standard way to access the underlying concrete cache entry implementation in order to provide access to further, proprietary features.If the implementation does not support the specified class, the
IllegalArgumentException
is thrown.- 参数:
clazz
- the proprietary class or interface of the underlying concrete cache. It is this type that is returned.- 返回:
- an instance of the underlying concrete cache
-
tryLock
从接口复制的说明:Cache
Use this cache attempt to acquire a exclusive lock specified by the key, this method will not block. examples:try(AutoReleaseLock lock = cache.tryLock("MyKey",100, TimeUnit.SECONDS)){ if(lock != null){ // do something } }
MultiLevelCache
will use the last level cache to support this operation.- 参数:
key
- lockKeyexpire
- lock expire timetimeUnit
- lock expire time unit- 返回:
- an AutoReleaseLock(implements java.lang.AutoCloseable) instance if success. or null if the attempt fails, which indicates there is an another thread/process/server has the lock, or error occurs during cache access.
- 另请参阅:
-
putIfAbsent
从接口复制的说明:Cache
Atomically associates the specified key with the given value if it is not already associated with a value.If error occurs during cache access, the method will not throw an exception.
MultiLevelCache
does not support this method.- 参数:
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key- 返回:
- true if a value was set, false if the KV association does not exists in the cache, or error occurs during cache access.
- 另请参阅:
-
close
public void close()从接口复制的说明:Cache
Clean resources created by this cache.
-