Package org.apache.shiro.ee.cdi
Class ShiroScopeContext
java.lang.Object
org.apache.shiro.ee.cdi.ShiroScopeContext
- All Implemented Interfaces:
Serializable,javax.enterprise.context.spi.Context
public class ShiroScopeContext
extends Object
implements javax.enterprise.context.spi.Context, Serializable
If web environment, delegate to SessionScoped,
otherwise use Shiro sessions to store session beans
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionShiroScopeContext(Class<? extends Annotation> scopeType, Class<? extends Annotation> webScopeType) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddScopeSessionListeners(org.apache.shiro.web.mgt.WebSecurityManager wsm) <T> Tget(javax.enterprise.context.spi.Contextual<T> contextual) <T> Tget(javax.enterprise.context.spi.Contextual<T> contextual, javax.enterprise.context.spi.CreationalContext<T> creationalContext) Class<? extends Annotation>getScope()booleanisActive()static booleanisWebContainerSessions(org.apache.shiro.mgt.SecurityManager sm)
-
Constructor Details
-
ShiroScopeContext
public ShiroScopeContext(Class<? extends Annotation> scopeType, Class<? extends Annotation> webScopeType)
-
-
Method Details
-
getScope
- Specified by:
getScopein interfacejavax.enterprise.context.spi.Context
-
get
public <T> T get(javax.enterprise.context.spi.Contextual<T> contextual, javax.enterprise.context.spi.CreationalContext<T> creationalContext) - Specified by:
getin interfacejavax.enterprise.context.spi.Context
-
get
public <T> T get(javax.enterprise.context.spi.Contextual<T> contextual) - Specified by:
getin interfacejavax.enterprise.context.spi.Context
-
isActive
public boolean isActive()- Specified by:
isActivein interfacejavax.enterprise.context.spi.Context
-
isWebContainerSessions
public static boolean isWebContainerSessions(org.apache.shiro.mgt.SecurityManager sm) -
addScopeSessionListeners
public static void addScopeSessionListeners(org.apache.shiro.web.mgt.WebSecurityManager wsm)
-