/** * Sets the internal {@code CacheManager} on the {@code SessionDAO} if it implements the * {@link org.apache.shiro.cache.CacheManagerAware CacheManagerAware} interface. * <p/> * This method is called after setting a cacheManager via the * {@link #setCacheManager(org.apache.shiro.cache.CacheManager) setCacheManager} method <em>em</em> when * setting a {@code SessionDAO} via the {@link #setSessionDAO} method to allow it to be propagated * in either case. * * @since 1.0 */ private void applyCacheManagerToSessionDAO() { if (this.cacheManager != null && this.sessionDAO != null && this.sessionDAO instanceof CacheManagerAware) { ((CacheManagerAware) this.sessionDAO).setCacheManager(this.cacheManager); } }
/** * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set * {@link #setCacheManager CacheManager} so it may use it for its internal caching needs. * <p/> * Note: This implementation only injects the CacheManager into the SessionManager if the SessionManager * instance implements the {@link CacheManagerAware CacheManagerAware} interface. */ protected void applyCacheManagerToSessionManager() { if (this.sessionManager instanceof CacheManagerAware) { ((CacheManagerAware) this.sessionManager).setCacheManager(getCacheManager()); } }
/** * Sets the internal {@link #getCacheManager CacheManager} on any internal configured * {@link #getRealms Realms} that implement the {@link org.apache.shiro.cache.CacheManagerAware CacheManagerAware} interface. * <p/> * This method is called after setting a cacheManager on this securityManager via the * {@link #setCacheManager(org.apache.shiro.cache.CacheManager) setCacheManager} method to allow it to be propagated * down to all the internal Realms that would need to use it. * <p/> * It is also called after setting one or more realms via the {@link #setRealm setRealm} or * {@link #setRealms setRealms} methods to allow these newly available realms to be given the cache manager * already in use. */ protected void applyCacheManagerToRealms() { CacheManager cacheManager = getCacheManager(); Collection<Realm> realms = getRealms(); if (cacheManager != null && realms != null && !realms.isEmpty()) { for (Realm realm : realms) { if (realm instanceof CacheManagerAware) { ((CacheManagerAware) realm).setCacheManager(cacheManager); } } } }
/** * Sets the internal {@code CacheManager} on the {@code SessionDAO} if it implements the * {@link org.apache.shiro.cache.CacheManagerAware CacheManagerAware} interface. * <p/> * This method is called after setting a cacheManager via the * {@link #setCacheManager(org.apache.shiro.cache.CacheManager) setCacheManager} method <em>em</em> when * setting a {@code SessionDAO} via the {@link #setSessionDAO} method to allow it to be propagated * in either case. * * @since 1.0 */ private void applyCacheManagerToSessionDAO() { if (this.cacheManager != null && this.sessionDAO != null && this.sessionDAO instanceof CacheManagerAware) { ((CacheManagerAware) this.sessionDAO).setCacheManager(this.cacheManager); } }
/** * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set * {@link #setCacheManager CacheManager} so it may use it for its internal caching needs. * <p/> * Note: This implementation only injects the CacheManager into the SessionManager if the SessionManager * instance implements the {@link CacheManagerAware CacheManagerAware} interface. */ protected void applyCacheManagerToSessionManager() { if (this.sessionManager instanceof CacheManagerAware) { ((CacheManagerAware) this.sessionManager).setCacheManager(getCacheManager()); } }
/** * Sets the internal {@link #getCacheManager CacheManager} on any internal configured * {@link #getRealms Realms} that implement the {@link org.apache.shiro.cache.CacheManagerAware CacheManagerAware} interface. * <p/> * This method is called after setting a cacheManager on this securityManager via the * {@link #setCacheManager(org.apache.shiro.cache.CacheManager) setCacheManager} method to allow it to be propagated * down to all the internal Realms that would need to use it. * <p/> * It is also called after setting one or more realms via the {@link #setRealm setRealm} or * {@link #setRealms setRealms} methods to allow these newly available realms to be given the cache manager * already in use. */ protected void applyCacheManagerToRealms() { CacheManager cacheManager = getCacheManager(); Collection<Realm> realms = getRealms(); if (cacheManager != null && realms != null && !realms.isEmpty()) { for (Realm realm : realms) { if (realm instanceof CacheManagerAware) { ((CacheManagerAware) realm).setCacheManager(cacheManager); } } } }
/** * Sets the internal {@code CacheManager} on the {@code SessionDAO} if it implements the * {@link org.apache.shiro.cache.CacheManagerAware CacheManagerAware} interface. * <p/> * This method is called after setting a cacheManager via the * {@link #setCacheManager(org.apache.shiro.cache.CacheManager) setCacheManager} method <em>em</em> when * setting a {@code SessionDAO} via the {@link #setSessionDAO} method to allow it to be propagated * in either case. * * @since 1.0 */ private void applyCacheManagerToSessionDAO() { if (this.cacheManager != null && this.sessionDAO != null && this.sessionDAO instanceof CacheManagerAware) { ((CacheManagerAware) this.sessionDAO).setCacheManager(this.cacheManager); } }
/** * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set * {@link #setCacheManager CacheManager} so it may use it for its internal caching needs. * <p/> * Note: This implementation only injects the CacheManager into the SessionManager if the SessionManager * instance implements the {@link CacheManagerAware CacheManagerAware} interface. */ protected void applyCacheManagerToSessionManager() { if (this.sessionManager instanceof CacheManagerAware) { ((CacheManagerAware) this.sessionManager).setCacheManager(getCacheManager()); } }
/** * Sets the internal {@link #getCacheManager CacheManager} on any internal configured * {@link #getRealms Realms} that implement the {@link org.apache.shiro.cache.CacheManagerAware CacheManagerAware} interface. * <p/> * This method is called after setting a cacheManager on this securityManager via the * {@link #setCacheManager(org.apache.shiro.cache.CacheManager) setCacheManager} method to allow it to be propagated * down to all the internal Realms that would need to use it. * <p/> * It is also called after setting one or more realms via the {@link #setRealm setRealm} or * {@link #setRealms setRealms} methods to allow these newly available realms to be given the cache manager * already in use. */ protected void applyCacheManagerToRealms() { CacheManager cacheManager = getCacheManager(); Collection<Realm> realms = getRealms(); if (cacheManager != null && realms != null && !realms.isEmpty()) { for (Realm realm : realms) { if (realm instanceof CacheManagerAware) { ((CacheManagerAware) realm).setCacheManager(cacheManager); } } } }