Example usage for org.apache.shiro.cache Cache size

List of usage examples for org.apache.shiro.cache Cache size

Introduction

In this page you can find the example usage for org.apache.shiro.cache Cache size.

Prototype

public int size();

Source Link

Document

Returns the number of entries in the cache.

Usage

From source file:com.zht.common.shiro.realm.ShiroDbRealm.java

License:Apache License

/**
 * ??.//from  w ww  .  j  av a2s. c  o m
 */
public void clearAllCachedAuthorizationInfo() {
    Cache<Object, AuthorizationInfo> cache = getAuthorizationCache();
    if (cache != null && cache.size() > 0) {
        Set<?> keys = cache.keys();
        for (Object key : keys) {
            cache.remove(key);
        }
    }
}