public abstract class ShiroModule
extends com.google.inject.PrivateModule
implements org.apache.shiro.util.Destroyable
SecurityManager and SessionManager. At least one realm must be added by using
bindRealm.| Constructor and Description |
|---|
ShiroModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.apache.shiro.util.Destroyable destroyable) |
protected <T> void |
bindBeanType(com.google.inject.TypeLiteral<T> typeLiteral,
com.google.inject.Key<? extends T> key)
Binds a key to use for injecting setters in shiro classes.
|
protected void |
bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.env.Environment> bind)
Binds the environment.
|
protected void |
bindEventBus(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.event.EventBus> bind)
Binds the EventBus.
|
protected com.google.inject.binder.LinkedBindingBuilder<org.apache.shiro.realm.Realm> |
bindRealm()
This is the preferred manner to bind a realm.
|
protected void |
bindSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.mgt.SecurityManager> bind)
Binds the security manager.
|
protected void |
bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.session.mgt.SessionManager> bind)
Binds the session manager.
|
void |
configure() |
protected abstract void |
configureShiro()
Implement this method in order to configure your realms and any other Shiro customization you may need.
|
void |
destroy()
Destroys all beans created within this module that implement
Destroyable. |
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, expose, expose, expose, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBindingpublic void configure()
configure in class com.google.inject.PrivateModuleprotected abstract void configureShiro()
protected final com.google.inject.binder.LinkedBindingBuilder<org.apache.shiro.realm.Realm> bindRealm()
SecurityManager will be injected with any Realm bound
with this method.protected void bindSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super org.apache.shiro.mgt.SecurityManager> bind)
DefaultSecurityManager is bound as an eager singleton.bind - protected void bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.session.mgt.SessionManager> bind)
DefaultSessionManager is bound as an eager singleton.bind - protected void bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.env.Environment> bind)
GuiceEnvironment is bound as an eager singleton.bind - protected final <T> void bindBeanType(com.google.inject.TypeLiteral<T> typeLiteral,
com.google.inject.Key<? extends T> key)
T - typeLiteral - the bean property typekey - the key to use to satisfy the bean property dependencyprotected void bindEventBus(com.google.inject.binder.AnnotatedBindingBuilder<org.apache.shiro.event.EventBus> bind)
EventBus binding.bind - public final void destroy()
Destroyable. Should be called when this
module will no longer be used.destroy in interface org.apache.shiro.util.DestroyableExceptionpublic void add(org.apache.shiro.util.Destroyable destroyable)
Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.