前言:

    JEECG默认缓存采用的是Eache,如何切换Redis,jeecg已经提供方案如下,主要修改两方面内容,第一个是AOP拦截器,第二个是缓存工具类,具体参考如下:

一、切换AOP拦截器

1.注释Eache拦截器

    打开org.jeecgframework.core.aop. EhcacheAspect类,如图中红框所示,

    注释@Component、@Aspect 注解。

 【JEECG技术文档】Redis与Eache切换文档

 

2.启用Redis拦截器

    打开org.jeecgframework.core.aop. RedisCacheAspect类,如图中所示,

    放开@Component、@Aspect 注解。

 【JEECG技术文档】Redis与Eache切换文档

二、切换缓存工具类

    找到系统中使用org.jeecgframework.core.util. EhcacheUtil类操作缓存的地方,

    替换成org.jeecgframework.core.util. RedisCacheUtil类 操作缓存(全文搜索替换)。

 

    至此就完成了Eache缓存切换到Redis缓存了,如果想从Redis缓存切换回Eache缓存把上述操作反过来既可。

转载于:https://my.oschina.net/jeecg/blog/1625254

相关文章:

  • 2022-01-02
  • 2021-12-22
  • 2021-12-18
  • 2022-01-09
  • 2022-12-23
  • 2021-09-05
猜你喜欢
  • 2022-12-23
  • 2021-06-10
  • 2021-12-23
  • 2022-12-23
  • 2021-11-10
相关资源
相似解决方案