|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.inject.PrivateModule
org.apache.shiro.guice.ShiroModule
org.apache.shiro.guice.web.ShiroWebModule
public abstract class ShiroWebModule
Sets up Shiro lifecycles within Guice, enables the injecting of Shiro objects, and binds a default
WebSecurityManager, SecurityManager and SessionManager. At least one realm must be added by
using bindRealm.
FilterChainResolver with that information.
| Field Summary | |
|---|---|
static com.google.inject.Key<AnonymousFilter> |
ANON
|
static com.google.inject.Key<FormAuthenticationFilter> |
AUTHC
|
static com.google.inject.Key<BasicHttpAuthenticationFilter> |
AUTHC_BASIC
|
static com.google.inject.Key<LogoutFilter> |
LOGOUT
|
static com.google.inject.Key<NoSessionCreationFilter> |
NO_SESSION_CREATION
|
static com.google.inject.Key<PermissionsAuthorizationFilter> |
PERMS
|
static com.google.inject.Key<PortFilter> |
PORT
|
static com.google.inject.Key<HttpMethodPermissionFilter> |
REST
|
static com.google.inject.Key<RolesAuthorizationFilter> |
ROLES
|
static com.google.inject.Key<SslFilter> |
SSL
|
static com.google.inject.Key<UserFilter> |
USER
|
| Constructor Summary | |
|---|---|
ShiroWebModule(javax.servlet.ServletContext servletContext)
|
|
| Method Summary | ||
|---|---|---|
protected void |
addFilterChain(String pattern,
com.google.inject.Key<? extends javax.servlet.Filter>... keys)
Adds a filter chain to the shiro configuration. |
|
protected void |
bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<Environment> bind)
Binds the environment. |
|
static void |
bindGuiceFilter(com.google.inject.Binder binder)
|
|
static void |
bindGuiceFilter(String pattern,
com.google.inject.Binder binder)
|
|
protected void |
bindSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super SecurityManager> bind)
Binds the security manager. |
|
protected void |
bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<SessionManager> bind)
Binds the session manager. |
|
protected void |
bindWebEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<? super WebEnvironment> bind)
|
|
protected void |
bindWebSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super WebSecurityManager> bind)
Binds the security manager. |
|
protected static
|
config(Class<T> type,
String configValue)
|
|
protected static
|
config(com.google.inject.Key<T> baseKey,
String configValue)
|
|
protected static
|
config(com.google.inject.TypeLiteral<T> typeLiteral,
String configValue)
|
|
protected void |
configureShiro()
Implement this method in order to configure your realms and any other Shiro customization you may need. |
|
protected abstract void |
configureShiroWeb()
|
|
static com.google.inject.servlet.ServletModule |
guiceFilterModule()
|
|
static com.google.inject.servlet.ServletModule |
guiceFilterModule(String pattern)
|
|
| Methods inherited from class org.apache.shiro.guice.ShiroModule |
|---|
add, bindBeanType, bindRealm, configure, destroy |
| Methods inherited from class com.google.inject.PrivateModule |
|---|
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, requireBinding |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final com.google.inject.Key<AnonymousFilter> ANON
public static final com.google.inject.Key<FormAuthenticationFilter> AUTHC
public static final com.google.inject.Key<BasicHttpAuthenticationFilter> AUTHC_BASIC
public static final com.google.inject.Key<NoSessionCreationFilter> NO_SESSION_CREATION
public static final com.google.inject.Key<LogoutFilter> LOGOUT
public static final com.google.inject.Key<PermissionsAuthorizationFilter> PERMS
public static final com.google.inject.Key<PortFilter> PORT
public static final com.google.inject.Key<HttpMethodPermissionFilter> REST
public static final com.google.inject.Key<RolesAuthorizationFilter> ROLES
public static final com.google.inject.Key<SslFilter> SSL
public static final com.google.inject.Key<UserFilter> USER
| Constructor Detail |
|---|
public ShiroWebModule(javax.servlet.ServletContext servletContext)
| Method Detail |
|---|
public static void bindGuiceFilter(com.google.inject.Binder binder)
public static void bindGuiceFilter(String pattern,
com.google.inject.Binder binder)
public static com.google.inject.servlet.ServletModule guiceFilterModule()
public static com.google.inject.servlet.ServletModule guiceFilterModule(String pattern)
protected final void configureShiro()
ShiroModule
configureShiro in class ShiroModuleprotected abstract void configureShiroWeb()
protected final void bindSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super SecurityManager> bind)
ShiroModuleDefaultSecurityManager is bound as an eager singleton.
bindSecurityManager in class ShiroModuleprotected void bindWebSecurityManager(com.google.inject.binder.AnnotatedBindingBuilder<? super WebSecurityManager> bind)
DefaultWebSecurityManager is bound as an eager singleton.
bind - protected void bindSessionManager(com.google.inject.binder.AnnotatedBindingBuilder<SessionManager> bind)
DefaultWebSessionManager is bound as an eager singleton.
bindSessionManager in class ShiroModulebind - protected final void bindEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<Environment> bind)
ShiroModuleGuiceEnvironment is bound as an eager singleton.
bindEnvironment in class ShiroModuleprotected void bindWebEnvironment(com.google.inject.binder.AnnotatedBindingBuilder<? super WebEnvironment> bind)
protected final void addFilterChain(String pattern,
com.google.inject.Key<? extends javax.servlet.Filter>... keys)
PathMatchingFilter, it will be registered with a proper
provider.
pattern - keys -
protected static <T extends PathMatchingFilter> com.google.inject.Key<T> config(com.google.inject.Key<T> baseKey,
String configValue)
protected static <T extends PathMatchingFilter> com.google.inject.Key<T> config(com.google.inject.TypeLiteral<T> typeLiteral,
String configValue)
protected static <T extends PathMatchingFilter> com.google.inject.Key<T> config(Class<T> type,
String configValue)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||