java.lang.Object
org.miaixz.bus.cache.Complex
缓存复合操作类,提供缓存读写、删除等核心功能
该类是缓存框架的核心处理器,负责协调缓存读取、写入和删除操作, 支持单键和多键缓存操作,并提供条件判断和SpEL表达式解析功能。
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisSwitchOn(Context config, CachedGet cachedGet, Method method, Object[] args) 判断缓存开关是否打开static booleanisSwitchOn(Context config, Cached cached, Method method, Object[] args) 判断缓存开关是否打开static booleanisSwitchOn(Context config, Invalid invalid, Method method, Object[] args) 判断缓存开关是否打开执行缓存读取操作执行缓存读写操作void执行缓存删除操作voidsetContext(Context context) 设置缓存上下文配置void设置缓存管理器voidsetMultiCacheReader(AbstractReader multiCacheReader) 设置多键缓存读取器voidsetSingleCacheReader(AbstractReader singleCacheReader) 设置单键缓存读取器voidwrite()执行缓存写入操作(待实现)
-
Constructor Details
-
Complex
public Complex()
-
-
Method Details
-
isSwitchOn
判断缓存开关是否打开- Parameters:
config- 缓存配置cached- 缓存注解method- 方法对象args- 方法参数- Returns:
- 如果缓存开关打开且满足条件则返回true,否则返回false
-
isSwitchOn
判断缓存开关是否打开- Parameters:
config- 缓存配置invalid- 失效注解method- 方法对象args- 方法参数- Returns:
- 如果缓存开关打开且满足条件则返回true,否则返回false
-
isSwitchOn
判断缓存开关是否打开- Parameters:
config- 缓存配置cachedGet- 获取缓存注解method- 方法对象args- 方法参数- Returns:
- 如果缓存开关打开且满足条件则返回true,否则返回false
-
read
public Object read(CachedGet cachedGet, Method method, org.miaixz.bus.proxy.invoker.ProxyChain baseInvoker) throws Throwable 执行缓存读取操作- Parameters:
cachedGet- 获取缓存注解method- 方法对象baseInvoker- 代理调用链- Returns:
- 缓存值或方法执行结果
- Throws:
Throwable- 可能抛出的异常
-
readWrite
public Object readWrite(Cached cached, Method method, org.miaixz.bus.proxy.invoker.ProxyChain baseInvoker) throws Throwable 执行缓存读写操作- Parameters:
cached- 缓存注解method- 方法对象baseInvoker- 代理调用链- Returns:
- 缓存值或方法执行结果
- Throws:
Throwable- 可能抛出的异常
-
remove
执行缓存删除操作- Parameters:
invalid- 失效注解method- 方法对象args- 方法参数
-
write
public void write()执行缓存写入操作(待实现) -
setContext
设置缓存上下文配置- Parameters:
context- 缓存上下文配置
-
setManage
设置缓存管理器- Parameters:
manage- 缓存管理器
-
setSingleCacheReader
设置单键缓存读取器- Parameters:
singleCacheReader- 单键缓存读取器
-
setMultiCacheReader
设置多键缓存读取器- Parameters:
multiCacheReader- 多键缓存读取器
-