Package org.apache.shiro.web.mgt
Class DefaultWebSubjectFactory
- java.lang.Object
-
- org.apache.shiro.mgt.DefaultSubjectFactory
-
- org.apache.shiro.web.mgt.DefaultWebSubjectFactory
-
- All Implemented Interfaces:
SubjectFactory
- Direct Known Subclasses:
CasSubjectFactory
public class DefaultWebSubjectFactory extends DefaultSubjectFactory
ASubjectFactory
implementation that createsWebDelegatingSubject
instances.WebDelegatingSubject
instances are required if Request/Response objects are to be maintained across threads when using theSubject
createCallable
andcreateRunnable
methods.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description DefaultWebSubjectFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Subject
createSubject(SubjectContext context)
Creates a new Subject instance reflecting the state of the specified contextual data.protected Subject
newSubjectInstance(PrincipalCollection principals, boolean authenticated, String host, Session session, ServletRequest request, ServletResponse response, SecurityManager securityManager)
Deprecated.since 1.2 - overridecreateSubject(org.apache.shiro.subject.SubjectContext)
directly if you need to instantiate a customSubject
class.-
Methods inherited from class org.apache.shiro.mgt.DefaultSubjectFactory
newSubjectInstance
-
-
-
-
Constructor Detail
-
DefaultWebSubjectFactory
public DefaultWebSubjectFactory()
-
-
Method Detail
-
createSubject
public Subject createSubject(SubjectContext context)
Description copied from interface:SubjectFactory
Creates a new Subject instance reflecting the state of the specified contextual data. The data would be anything required to required to construct aSubject
instance and its contents can vary based on environment. Any data supported by Shiro core will be accessible by one of theSubjectContext
'sget*
orresolve*
methods. All other data is available as mapattribute
s.- Specified by:
createSubject
in interfaceSubjectFactory
- Overrides:
createSubject
in classDefaultSubjectFactory
- Parameters:
context
- the contextual data to be used by the implementation to construct an appropriateSubject
instance.- Returns:
- a
Subject
instance created based on the specified context. - See Also:
SubjectContext
-
newSubjectInstance
@Deprecated protected Subject newSubjectInstance(PrincipalCollection principals, boolean authenticated, String host, Session session, ServletRequest request, ServletResponse response, SecurityManager securityManager)
Deprecated.since 1.2 - overridecreateSubject(org.apache.shiro.subject.SubjectContext)
directly if you need to instantiate a customSubject
class.
-
-