org.apache.shiro.mgt
Class CachingSecurityManager

java.lang.Object
  extended by org.apache.shiro.mgt.CachingSecurityManager
All Implemented Interfaces:
Authenticator, Authorizer, CacheManagerAware, SecurityManager, SessionManager, Destroyable
Direct Known Subclasses:
RealmSecurityManager

public abstract class CachingSecurityManager
extends Object
implements SecurityManager, Destroyable, CacheManagerAware

A very basic starting point for the SecurityManager interface that merely provides logging and caching support. All actual SecurityManager method implementations are left to subclasses.

Change in 1.0 - a default CacheManager instance is not created by default during instantiation. As caching strategies can vary greatly depending on an application's needs, a CacheManager instance must be explicitly configured if caching across the framework is to be enabled.

Since:
0.9

Constructor Summary
CachingSecurityManager()
          Default no-arg constructor that will automatically attempt to initialize a default cacheManager
 
Method Summary
protected  void afterCacheManagerSet()
          Template callback to notify subclasses that a CacheManager has been set and is available for use via the getCacheManager() method.
 void destroy()
          Destroys the cacheManager via LifecycleUtils.destroy.
 CacheManager getCacheManager()
          Returns the CacheManager used by this SecurityManager.
 void setCacheManager(CacheManager cacheManager)
          Sets the CacheManager used by this SecurityManager and potentially any of its children components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.shiro.mgt.SecurityManager
createSubject, login, logout
 
Methods inherited from interface org.apache.shiro.authc.Authenticator
authenticate
 
Methods inherited from interface org.apache.shiro.authz.Authorizer
checkPermission, checkPermission, checkPermissions, checkPermissions, checkRole, checkRoles, checkRoles, hasAllRoles, hasRole, hasRoles, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll
 
Methods inherited from interface org.apache.shiro.session.mgt.SessionManager
getSession, start
 

Constructor Detail

CachingSecurityManager

public CachingSecurityManager()
Default no-arg constructor that will automatically attempt to initialize a default cacheManager

Method Detail

getCacheManager

public CacheManager getCacheManager()
Returns the CacheManager used by this SecurityManager.

Returns:
the cacheManager used by this SecurityManager

setCacheManager

public void setCacheManager(CacheManager cacheManager)
Sets the CacheManager used by this SecurityManager and potentially any of its children components.

After the cacheManager attribute has been set, the template method afterCacheManagerSet() is executed to allow subclasses to adjust when a cacheManager is available.

Specified by:
setCacheManager in interface CacheManagerAware
Parameters:
cacheManager - the CacheManager used by this SecurityManager and potentially any of its children components.

afterCacheManagerSet

protected void afterCacheManagerSet()
Template callback to notify subclasses that a CacheManager has been set and is available for use via the getCacheManager() method.


destroy

public void destroy()
Destroys the cacheManager via LifecycleUtils.destroy.

Specified by:
destroy in interface Destroyable


Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.