/** * Returns any available {@link Cache} instance to use for authentication caching. This functions as follows: * <ol> * <li>If an {@link #setAuthenticationCache(org.apache.shiro.cache.Cache) authenticationCache} has been explicitly * configured (it is not null), it is returned.</li> * <li>If there is no {@link #getAuthenticationCache() authenticationCache} configured: * <ol> * <li>If authentication caching is {@link #isAuthenticationCachingEnabled() enabled}, any available * {@link #getCacheManager() cacheManager} will be consulted to obtain an available authentication cache. * </li> * <li>If authentication caching is disabled, this implementation does nothing.</li> * </ol> * </li> * </ol> * * @return any available {@link Cache} instance to use for authentication caching. */ private Cache<Object, AuthenticationInfo> getAvailableAuthenticationCache() { Cache<Object, AuthenticationInfo> cache = getAuthenticationCache(); boolean authcCachingEnabled = isAuthenticationCachingEnabled(); if (cache == null && authcCachingEnabled) { cache = getAuthenticationCacheLazy(); } return cache; }
/** * Returns any available {@link Cache} instance to use for authentication caching. This functions as follows: * <ol> * <li>If an {@link #setAuthenticationCache(org.apache.shiro.cache.Cache) authenticationCache} has been explicitly * configured (it is not null), it is returned.</li> * <li>If there is no {@link #getAuthenticationCache() authenticationCache} configured: * <ol> * <li>If authentication caching is {@link #isAuthenticationCachingEnabled() enabled}, any available * {@link #getCacheManager() cacheManager} will be consulted to obtain an available authentication cache. * </li> * <li>If authentication caching is disabled, this implementation does nothing.</li> * </ol> * </li> * </ol> * * @return any available {@link Cache} instance to use for authentication caching. */ private Cache<Object, AuthenticationInfo> getAvailableAuthenticationCache() { Cache<Object, AuthenticationInfo> cache = getAuthenticationCache(); boolean authcCachingEnabled = isAuthenticationCachingEnabled(); if (cache == null && authcCachingEnabled) { cache = getAuthenticationCacheLazy(); } return cache; }