<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 23. CacheManager 緩存管理 # 23. CacheManager 緩存管理 Shiro 有三個重要的緩存接口: - [CacheManager](http://shiro.apache.org/static/current/apidocs/org/apache/shiro/cache/CacheManager.html) - 負責所有緩存的主要管理組件,它返回 Cache 實例。 - [Cache](http://shiro.apache.org/static/current/apidocs/org/apache/shiro/cache/Cache.html) - 維護key/value 對。 - [CacheManagerAware](http://shiro.apache.org/static/current/apidocs/org/apache/shiro/cache/CacheManagerAware.html) - 通過想要接收和使用 CacheManager 實例的組件來實現。 CacheManager 返回Cache 實例,各種不同的 Shiro 組件使用這些Cache 實例來緩存必要的數據。任何實現了 CacheManagerAware 的 Shiro 組件將會自動地接收一個配置好的 CacheManager,該 CacheManager 能夠用來獲取 Cache 實例。 Shiro 的 [SecurityManager](http://shiro.apache.org/securitymanager.html) 實現及所有 [AuthorizingRealm](http://shiro.apache.org/static/current/apidocs/org/apache/shiro/realm/AuthenticatingRealm.html) 實現都實現了 CacheManagerAware 。如果你在 SecurityManager 上設置了 CacheManger,它反過來也會將它設置到實現了CacheManagerAware 的各種不同的 Realm 上(OO delegation)。例如,在 shiro.ini 中: ``` securityManager.realms = $myRealm1, $myRealm2, ..., $myRealmN ... cacheManager = my.implementation.of.CacheManager ... securityManager.cacheManager = $cacheManager # at this point, the securityManager and all CacheManagerAware # realms have been set with the cacheManager instance ``` 我們有開箱即用的 [EhCacheManager](http://shiro.apache.org/static/current/apidocs/org/apache/shiro/cache/ehcache/EhCacheManager.html)實現 ,所以馬上就能使用它。否則,您也可以很好的實現自己的 CacheManager (例如 Coherence,等),配置如上。 ## Authorization Cache Invalidation 授權緩存失效 最后請注意, [AuthorizingRealm](http://shiro.apache.org/static/current/apidocs/org/apache/shiro/realm/AuthorizingRealm.html) 有一個 [clearCachedAuthorizationInfo](http://shiro.apache.org/static/current/apidocs/org/apache/shiro/realm/AuthorizingRealm.html#clearCachedAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection)) 方法能夠被子類調用,用來清除特殊賬戶緩存的授權信息。它通常被自定義邏輯調用,如果與之匹配的賬戶授權數據發生了改變(來確保下次的授權檢查能夠捕獲新數據)。 ## 為文檔加把手 我們希望這篇文檔可以幫助你使用 Apache Shiro 進行工作,社區一直在不斷地完善和擴展文檔,如果你希望幫助 Shiro 項目,請在你認為需要的地方考慮更正、擴展或添加文檔,你提供的任何點滴幫助都將擴充社區并且提升 Shiro。 提供你的文檔的最簡單的途徑是將它發送到用戶[論壇](http://shiro-user.582556.n2.nabble.com/)或[郵件列表](http://shiro.apache.org/mailing-lists.html) *譯者注:*如果對本中文翻譯有疑議的或發現勘誤歡迎指正,[點此](https://github.com/waylau/apache-shiro-1.2.x-reference/issues)提問。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看