@Ignored public interface ICaches extends IInitialization<IApplication>, IDestroyable
Modifier and Type | Interface and Description |
---|---|
static class |
ICaches.Scope
缓存作用域
|
Modifier and Type | Field and Description |
---|---|
static String |
MODULE_NAME |
Modifier and Type | Method and Description |
---|---|
void |
clear()
清理默认缓存
|
void |
clear(String cacheName)
清理指定名称的缓存
|
Object |
get(Object key)
从默认缓存中获取key对应的对象
|
Object |
get(String cacheName,
Object key)
从指定名称的缓存中获取key对应的对象
|
Map<Object,Object> |
getAll()
从默认缓存中获取所有缓存对象映射
|
Map<Object,Object> |
getAll(String cacheName)
从指定名称的缓存中获取所有缓存对象映射
|
ICacheConfig |
getConfig()
获取缓存配置
|
IApplication |
getOwner()
获取所属应用容器
|
boolean |
isMultilevel()
是否为Multilevel模式
|
List<?> |
keys()
获取默认缓存中所有key值集合
|
List<?> |
keys(String cacheName)
获取指定名称的缓存中所有key值集合
|
void |
put(Object key,
Object value)
添加对象到默认缓存中
|
void |
put(Object key,
Object value,
int timeout)
添加对象到默认缓存中
|
void |
put(String cacheName,
Object key,
Object value)
添加对象到指定名称的缓存中
|
void |
put(String cacheName,
Object key,
Object value,
int timeout)
添加对象到指定名称的缓存中
|
void |
remove(Object key)
从默认缓存中移除对象
|
void |
remove(String cacheName,
Object key)
从指定名称的缓存中移除对象
|
void |
removeAll(List<?> keys)
批量从默认缓存中移除对象
|
void |
removeAll(String cacheName,
List<?> keys)
批量从指定名称的缓存中移除对象
|
void |
update(Object key,
Object value)
更新对象到默认缓存中
|
void |
update(Object key,
Object value,
int timeout) |
void |
update(String cacheName,
Object key,
Object value)
更新对象到指定名称的缓存中
|
void |
update(String cacheName,
Object key,
Object value,
int timeout)
更新对象到指定名称的缓存中
|
initialize, isInitialized
close
static final String MODULE_NAME
IApplication getOwner()
ICacheConfig getConfig()
boolean isMultilevel()
Object get(String cacheName, Object key) throws CacheException
cacheName
- 缓存名称key
- 缓存KeyCacheException
- 可能产生的异常Object get(Object key) throws CacheException
key
- 缓存KeyCacheException
- 可能产生的异常Map<Object,Object> getAll(String cacheName) throws CacheException
cacheName
- 缓存名称CacheException
- 可能产生的异常Map<Object,Object> getAll() throws CacheException
CacheException
- 可能产生的异常void put(String cacheName, Object key, Object value) throws CacheException
cacheName
- 缓存名称key
- 缓存Keyvalue
- 预缓存的元素对象CacheException
- 可能产生的异常void put(String cacheName, Object key, Object value, int timeout) throws CacheException
cacheName
- 缓存名称key
- 缓存Keyvalue
- 预缓存的元素对象timeout
- 自定义超时时间(秒),若为0则使用默认值CacheException
- 可能产生的异常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(String cacheName, Object key, Object value) throws CacheException
cacheName
- 缓存名称key
- 缓存Keyvalue
- 缓存元素对象CacheException
- 可能产生的异常void update(String cacheName, Object key, Object value, int timeout) throws CacheException
cacheName
- 缓存名称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
CacheException
List<?> keys(String cacheName) throws CacheException
cacheName
- 缓存名称CacheException
- 可能产生的异常List<?> keys() throws CacheException
CacheException
- 可能产生的异常void remove(String cacheName, Object key) throws CacheException
cacheName
- 缓存名称key
- 缓存KeyCacheException
- 可能产生的异常void remove(Object key) throws CacheException
key
- 缓存KeyCacheException
- 可能产生的异常void removeAll(String cacheName, List<?> keys) throws CacheException
cacheName
- 缓存名称keys
- 缓存KeyCacheException
- 可能产生的异常void removeAll(List<?> keys) throws CacheException
keys
- 缓存KeyCacheException
- 可能产生的异常void clear(String cacheName) throws CacheException
cacheName
- 缓存名称CacheException
- 可能产生的异常void clear() throws CacheException
CacheException
- 可能产生的异常Copyright © 2022. All rights reserved.