List of usage examples for org.apache.shiro.realm AuthorizingRealm getAuthorizationCache
public Cache<Object, AuthorizationInfo> getAuthorizationCache()
From source file:org.pepstock.jem.gwt.server.RolesManagerServiceImpl.java
License:Open Source License
/** * This method clears all authorizations cache when a role is changed.<br> * That's necessary to invalidate the cache and then to have the updates * soon available.//from w ww .j a v a2 s. c om */ private void clearAuthorizationCache() { RealmSecurityManager mgr = (RealmSecurityManager) SecurityUtils.getSecurityManager(); Collection<Realm> realmCollection = mgr.getRealms(); for (Realm realm : realmCollection) { if (realm instanceof AuthorizingRealm) { AuthorizingRealm authz = (AuthorizingRealm) realm; if (authz.isAuthorizationCachingEnabled()) { authz.getAuthorizationCache().clear(); } } } }