Module bus.cache

Class Complex

java.lang.Object
org.miaixz.bus.cache.Complex

public class Complex extends Object
缓存复合操作类,提供缓存读写、删除等核心功能

该类是缓存框架的核心处理器,负责协调缓存读取、写入和删除操作, 支持单键和多键缓存操作,并提供条件判断和SpEL表达式解析功能。

Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • Complex

      public Complex()
  • Method Details

    • isSwitchOn

      public static boolean isSwitchOn(Context config, Cached cached, Method method, Object[] args)
      判断缓存开关是否打开
      Parameters:
      config - 缓存配置
      cached - 缓存注解
      method - 方法对象
      args - 方法参数
      Returns:
      如果缓存开关打开且满足条件则返回true,否则返回false
    • isSwitchOn

      public static boolean isSwitchOn(Context config, Invalid invalid, Method method, Object[] args)
      判断缓存开关是否打开
      Parameters:
      config - 缓存配置
      invalid - 失效注解
      method - 方法对象
      args - 方法参数
      Returns:
      如果缓存开关打开且满足条件则返回true,否则返回false
    • isSwitchOn

      public static boolean isSwitchOn(Context config, CachedGet cachedGet, Method method, Object[] args)
      判断缓存开关是否打开
      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

      public void remove(Invalid invalid, Method method, Object[] args)
      执行缓存删除操作
      Parameters:
      invalid - 失效注解
      method - 方法对象
      args - 方法参数
    • write

      public void write()
      执行缓存写入操作(待实现)
    • setContext

      public void setContext(Context context)
      设置缓存上下文配置
      Parameters:
      context - 缓存上下文配置
    • setManage

      public void setManage(Manage manage)
      设置缓存管理器
      Parameters:
      manage - 缓存管理器
    • setSingleCacheReader

      public void setSingleCacheReader(AbstractReader singleCacheReader)
      设置单键缓存读取器
      Parameters:
      singleCacheReader - 单键缓存读取器
    • setMultiCacheReader

      public void setMultiCacheReader(AbstractReader multiCacheReader)
      设置多键缓存读取器
      Parameters:
      multiCacheReader - 多键缓存读取器