zoukankan      html  css  js  c++  java
  • shiro系列11:缓存

    一、简介:

    1、Shiro 内部相应的组件(DefaultSecurityManager)会自动检测相应的对象(如Realm)是否实现了 CacheManagerAware 并自动注入相应的 CacheManager。

    2、Shiro 提供了 CachingRealm,其实现了 CacheManagerAware 接口,提供了缓存的一些基础实现;AuthenticatingRealm 及 AuthorizingRealm 也分别提供了对AuthenticationInfo 和 AuthorizationInfo 信息的缓存

     

    二、使用

    1、在springboot中配置缓存:将缓存设置到Realm中

        
        @Bean
        public RedisCacheManager redisCacheManager(){
            return new RedisCacheManager();
        }
    
        @Bean
        public CustomRealm customRealm(){
            CustomRealm customRealm=new CustomRealm();
            customRealm.setCacheManager(redisCacheManager());
            return customRealm;
        }
  • 相关阅读:
    10.30 afternoon
    10.29 afternoon
    10.29 morning

    10.27 noip模拟试题
    codevs 3052 多米诺 二分图匹配
    poj 1849 Two
    10.26 noip模拟试题
    10.25 noip模拟试题
    .NET Core EF 版本问题
  • 原文地址:https://www.cnblogs.com/XueTing/p/13736681.html
Copyright © 2011-2022 走看看