public abstract class RealmSecurityManager extends CachingSecurityManager
SecurityManager
class hierarchy based around a collection of
Realm
s. All actual SecurityManager
method implementations are left to
subclasses.Constructor and Description |
---|
RealmSecurityManager()
Default no-arg constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterCacheManagerSet()
Simply calls
applyCacheManagerToRealms() to allow the
newly set CacheManager to be propagated to the internal collection of Realm
that would need to use it. |
protected void |
afterEventBusSet()
Template callback to notify subclasses that an
EventBus has been set and is available for use
via the getEventBus() method. |
protected void |
afterRealmsSet() |
protected void |
applyCacheManagerToRealms()
Sets the internal
CacheManager on any internal configured
Realms that implement the CacheManagerAware interface. |
protected void |
applyEventBusToRealms()
Sets the internal
EventBus on any internal configured
Realms that implement the EventBusAware interface. |
void |
destroy()
Destroys the
cacheManager via LifecycleUtils.destroy . |
Collection<Realm> |
getRealms()
Returns the
Realm s managed by this SecurityManager instance. |
void |
setRealm(Realm realm)
Convenience method for applications using a single realm that merely wraps the realm in a list and then invokes
the
setRealms(java.util.Collection<org.apache.shiro.realm.Realm>) method. |
void |
setRealms(Collection<Realm> realms)
Sets the realms managed by this SecurityManager instance.
|
applyEventBusToCacheManager, getCacheManager, getEventBus, setCacheManager, setEventBus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSubject, login, logout
authenticate
checkPermission, checkPermission, checkPermissions, checkPermissions, checkRole, checkRoles, checkRoles, hasAllRoles, hasRole, hasRoles, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll
getSession, start
public RealmSecurityManager()
public void setRealm(Realm realm)
setRealms(java.util.Collection<org.apache.shiro.realm.Realm>)
method.realm
- the realm to set for a single-realm application.public void setRealms(Collection<Realm> realms)
realms
- the realms managed by this SecurityManager instance.IllegalArgumentException
- if the realms collection is null or empty.protected void afterRealmsSet()
public Collection<Realm> getRealms()
Realm
s managed by this SecurityManager instance.Realm
s managed by this SecurityManager instance.protected void applyCacheManagerToRealms()
CacheManager
on any internal configured
Realms
that implement the CacheManagerAware
interface.
This method is called after setting a cacheManager on this securityManager via the
setCacheManager
method to allow it to be propagated
down to all the internal Realms that would need to use it.
It is also called after setting one or more realms via the setRealm
or
setRealms
methods to allow these newly available realms to be given the cache manager
already in use.protected void applyEventBusToRealms()
EventBus
on any internal configured
Realms
that implement the EventBusAware
interface.
This method is called after setting an eventBus on this securityManager via the
setEventBus
method to allow it to be propagated
down to all the internal Realms that would need to use it.
It is also called after setting one or more realms via the setRealm
or
setRealms
methods to allow these newly available realms to be given the EventBus
already in use.protected void afterCacheManagerSet()
applyCacheManagerToRealms()
to allow the
newly set CacheManager
to be propagated to the internal collection of Realm
that would need to use it.afterCacheManagerSet
in class CachingSecurityManager
protected void afterEventBusSet()
CachingSecurityManager
EventBus
has been set and is available for use
via the getEventBus()
method.afterEventBusSet
in class CachingSecurityManager
public void destroy()
CachingSecurityManager
cacheManager
via LifecycleUtils.destroy
.destroy
in interface Destroyable
destroy
in class CachingSecurityManager
Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.