@Ignored public interface ICache extends IDestroyable
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT |
static String |
MULTILEVEL |
static String |
REDIS |
| Modifier and Type | Method and Description |
|---|---|
ICacheLocker |
acquireCacheLocker()
获取缓存锁对象,若缓存实例不支持则返回null
|
void |
clear()
清理缓存
|
Object |
get(Object key)
从缓存中获取对象
|
List<?> |
keys()
获取当前所有缓存对象key的集合
|
void |
put(Object key,
Object value)
添加对象到缓存
|
void |
put(Object key,
Object value,
int timeout)
添加对象到缓存
|
void |
remove(Object key)
从缓存中移除对象
|
void |
removeAll(Collection<?> keys)
批量从缓存中移除对象
|
void |
update(Object key,
Object value)
更新对象到缓存
|
void |
update(Object key,
Object value,
int timeout)
更新对象到缓存
|
closestatic final String DEFAULT
static final String REDIS
static final String MULTILEVEL
Object get(Object key) throws CacheException
key - 缓存keyCacheException - 可能产生的异常void put(Object key, Object value) throws CacheException
key - 缓存keyvalue - 预缓存的元素对象CacheException - 可能产生的异常void put(Object key, Object value, int timeout) throws CacheException
key - 缓存keyvalue - 预缓存的元素对象timeout - 自定义超时时间(秒),若为0则使用默认值CacheException - 可能产生的异常void update(Object key, Object value) throws CacheException
key - 缓存keyvalue - 预缓存的元素对象CacheException - 可能产生的异常void update(Object key, Object value, int timeout) throws CacheException
key - 缓存keyvalue - 预缓存的元素对象timeout - 自定义超时时间(秒),若为0则使用默认值CacheException - 可能产生的异常List<?> keys() throws CacheException
CacheException - 可能产生的异常void remove(Object key) throws CacheException
key - 缓存keyCacheException - 可能产生的异常void removeAll(Collection<?> keys) throws CacheException
keys - 缓存key集合CacheException - 可能产生的异常void clear()
throws CacheException
CacheException - 可能产生的异常ICacheLocker acquireCacheLocker()
Copyright © 2022. All rights reserved.