Apache的shiro 要使用自定义的cache要自己实现 cacheManager 和 Cache 这两个接口
Shiro has three important cache interfaces:
A CacheManager returns Cache instances and various Shiro components use those Cache instances to cache data as necessary. Any Shiro
component that implements CacheManager will automatically receive a configured CacheManager, where it can be used to acquire Cacheinstances.
Shiro只提供了 ehcache 和 concurrentHashMap 这两种自带实现。并且这方面的文档极少,shiro-redis可以帮助你快速的解决问题
官网:https://github.com/alexxiyang/shiro-redis
用法:
How to use it?
使用方法就不写了,因为一直在更新中,所以具体看项目文档
本文介绍了Apache Shiro中自定义缓存的方法,包括实现CacheManager和Cache接口。Shiro内置了ehcache和concurrentHashMap两种缓存实现,并推荐了一个第三方解决方案shiro-redis。
1万+

被折叠的 条评论
为什么被折叠?



