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

前言:

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

一、切换AOP拦截器

1.注释Eache拦截器

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

    注释@Component、@Aspect 注解。

 

2.启用Redis拦截器

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

    放开@Component、@Aspect 注解。

 

二、切换缓存工具类

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

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

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

猜你喜欢

转载自my.oschina.net/jeecg/blog/1625254