當前位置: 首頁>>代碼示例>>Java>>正文


Java CacheManager.getCache方法代碼示例

本文整理匯總了Java中org.apache.shiro.cache.CacheManager.getCache方法的典型用法代碼示例。如果您正苦於以下問題:Java CacheManager.getCache方法的具體用法?Java CacheManager.getCache怎麽用?Java CacheManager.getCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.shiro.cache.CacheManager的用法示例。


在下文中一共展示了CacheManager.getCache方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAuthenticationCacheLazy

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
/**
 * Checks to see if the authenticationCache class attribute is null, and if so, attempts to acquire one from
 * any configured {@link #getCacheManager() cacheManager}.  If one is acquired, it is set as the class attribute.
 * The class attribute is then returned.
 *
 * @return an available cache instance to be used for authentication caching or {@code null} if one is not available.
 * @since 1.2
 */
private Cache<Object, AuthenticationInfo> getAuthenticationCacheLazy() {

    if (this.authenticationCache == null) {

        log.trace("No authenticationCache instance set.  Checking for a cacheManager...");

        CacheManager cacheManager = getCacheManager();

        if (cacheManager != null) {
            String cacheName = getAuthenticationCacheName();
            log.debug("CacheManager [{}] configured.  Building authentication cache '{}'", cacheManager, cacheName);
            this.authenticationCache = cacheManager.getCache(cacheName);
        }
    }

    return this.authenticationCache;
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:26,代碼來源:AuthenticatingRealm.java

示例2: createActiveSessionsCache

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
protected RedisCache<String, Session> createActiveSessionsCache() {
	RedisCache<String, Session> cache = null;
	CacheManager mgr = getCacheManager();
	if (mgr != null) {
		cache = (RedisCache) mgr.getCache(ACTIVE_SESSION_CACHE_NAME);
	}
	return cache;
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:9,代碼來源:RedisSessionDAO.java

示例3: getAuthorizationCacheLazy

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
private Cache<Object, AuthorizationInfo> getAuthorizationCacheLazy() {

        if (this.authorizationCache == null) {

            if (log.isDebugEnabled()) {
                log.debug("No authorizationCache instance set.  Checking for a cacheManager...");
            }

            CacheManager cacheManager = getCacheManager();

            if (cacheManager != null) {
                String cacheName = getAuthorizationCacheName();
                if (log.isDebugEnabled()) {
                    log.debug("CacheManager [" + cacheManager + "] has been configured.  Building " +
                            "authorization cache named [" + cacheName + "]");
                }
                this.authorizationCache = cacheManager.getCache(cacheName);
            } else {
                if (log.isDebugEnabled()) {
                    log.debug("No cache or cacheManager properties have been set.  Authorization cache cannot " +
                            "be obtained.");
                }
            }
        }

        return this.authorizationCache;
    }
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:28,代碼來源:AuthorizingRealm.java

示例4: getAuthorizationCacheLazy

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
/**
 * {@inheritDoc} <br />
 * Original code from {@link AuthorizingRealm}, copied and modified due to
 * dependency of {@link #getAvailableAuthorizationCache()}
 */
private Cache<Object, AuthorizationInfo> getAuthorizationCacheLazy() {
	Cache<Object, AuthorizationInfo> authorizationCache = this.getAuthorizationCache();
	if ( authorizationCache == null ) {

		if ( log.isDebugEnabled() ) {
			log.debug( "No authorizationCache instance set.  Checking for a cacheManager..." );
		}

		CacheManager cacheManager = this.getCacheManager();

		if ( cacheManager != null ) {
			String cacheName = this.getAuthorizationCacheName();
			if ( log.isDebugEnabled() ) {
				log.debug( "CacheManager [" + cacheManager + "] has been configured.  Building " + "authorization cache named [" + cacheName + "]" );
			}
			authorizationCache = cacheManager.getCache( cacheName );
		}
		else {
			if ( log.isInfoEnabled() ) {
				log.info( "No cache or cacheManager properties have been set.  Authorization cache cannot " + "be obtained." );
			}
		}
	}

	return authorizationCache;
}
 
開發者ID:PE-INTERNATIONAL,項目名稱:soda4lca,代碼行數:32,代碼來源:IlcdSecurityRealm.java

示例5: HashedCredentials2Matcher

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public HashedCredentials2Matcher(CacheManager cacheManager) {
	faultPasswordCache = cacheManager.getCache("faultPasswordCache");
}
 
開發者ID:jiangzongyao,項目名稱:kettle_support_kettle8.0,代碼行數:4,代碼來源:HashedCredentials2Matcher.java

示例6: setCacheManager

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public void setCacheManager(CacheManager cacheManager) {
	this.cache = cacheManager.getCache("forcedSessionsCache");
}
 
開發者ID:jiangzongyao,項目名稱:kettle_support_kettle8.0,代碼行數:4,代碼來源:AccessControl2Filter.java

示例7: RetryLimitHashedCredentialsMatcher

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public RetryLimitHashedCredentialsMatcher(CacheManager cacheManager) {
    passwordRetryCache = cacheManager.getCache("passwordRetryCache");
}
 
開發者ID:liaojiacan,項目名稱:zkAdmin,代碼行數:4,代碼來源:RetryLimitHashedCredentialsMatcher.java

示例8: LimitRetryCredentialsMatcher

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public LimitRetryCredentialsMatcher(CacheManager cacheManager, RedisManager redisManager) {
    this.passwordRetryCache = cacheManager.getCache("passwordRetryCache");
    this.redisManager = redisManager;
}
 
開發者ID:wjggwm,項目名稱:webside,代碼行數:5,代碼來源:LimitRetryCredentialsMatcher.java

示例9: setCacheManager

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public void setCacheManager(CacheManager cacheManager) {
	this.cache = cacheManager.getCache("shiro-kickout-session");
}
 
開發者ID:simbest,項目名稱:simbest-cores,代碼行數:4,代碼來源:KickoutSessionControlFilter.java

示例10: RetryLimitMatcher

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public RetryLimitMatcher(CacheManager cacheManager) {
    passwordRetryCache = cacheManager.getCache("passwordRetryCache");
    maxRetry = 5;
}
 
開發者ID:storezhang,項目名稱:utils,代碼行數:5,代碼來源:RetryLimitMatcher.java

示例11: RetryLimitMd5CredentialsMatcher

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public RetryLimitMd5CredentialsMatcher(CacheManager cacheManager, Integer maxRetryCount) {
	passwordRetryCache = cacheManager.getCache("password_retry");
	this.maxRetryCount = maxRetryCount;
	setHashAlgorithmName(Md5Hash.ALGORITHM_NAME);
}
 
開發者ID:xiangxik,項目名稱:java-platform,代碼行數:6,代碼來源:RetryLimitMd5CredentialsMatcher.java

示例12: RetryLimitHashedCredentialsMatcher

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public RetryLimitHashedCredentialsMatcher(CacheManager cacheManager) {
	passwordRetryCache = cacheManager.getCache("passwordRetryCache");
}
 
開發者ID:inexistence,項目名稱:VideoMeeting,代碼行數:4,代碼來源:RetryLimitHashedCredentialsMatcher.java

示例13: RetryLimitCredentialsMatcher

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
public RetryLimitCredentialsMatcher(final CacheManager cacheManager) {
  Cache<String, AtomicInteger> _cache = cacheManager.<String, AtomicInteger>getCache("passwordRetryCache");
  this.passwordRetryCache = _cache;
}
 
開發者ID:East196,項目名稱:maker,代碼行數:5,代碼來源:RetryLimitCredentialsMatcher.java

示例14: createActiveSessionsCache

import org.apache.shiro.cache.CacheManager; //導入方法依賴的package包/類
/**
 * Creates a cache instance used to store active sessions.  Creation is done by first
 * {@link #getCacheManager() acquiring} the {@code CacheManager}.  If the cache manager is not null, the
 * cache returned is that resulting from the following call:
 * <pre>       String name = {@link #getActiveSessionsCacheName() getActiveSessionsCacheName()};
 * cacheManager.getCache(name);</pre>
 *
 * @return a cache instance used to store active sessions, or {@code null} if the {@code CacheManager} has
 *         not been set.
 */
protected Cache<Serializable, Session> createActiveSessionsCache() {
    Cache<Serializable, Session> cache = null;
    CacheManager mgr = getCacheManager();
    if (mgr != null) {
        String name = getActiveSessionsCacheName();
        cache = mgr.getCache(name);
    }
    return cache;
}
 
開發者ID:xuegongzi,項目名稱:rabbitframework,代碼行數:20,代碼來源:CachingSessionDAO.java


注:本文中的org.apache.shiro.cache.CacheManager.getCache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。