shiro 与 redis 结合的解决方案 shiro-redis

来源:互联网 发布:java微信飞机大战 编辑:程序博客网 时间:2024/06/08 11:32

Apache的shiro 要使用自定义的cache要自己实现  cacheManager 和 Cache 这两个接口

Shiro has three important cache interfaces:

  • CacheManager
  • Cache
  • CacheManagerAware

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?

使用方法就不写了,因为一直在更新中,所以具体看项目文档