public class ServletContainerSessionManager extends Object implements WebSessionManager
Session implementations that are merely wrappers for the
Servlet container's HttpSession.
Despite its name, this implementation does not itself manage Sessions since the Servlet container
provides the actual management support. This class mainly exists to 'impersonate' a regular Shiro
SessionManager so it can be pluggable into a normal Shiro configuration in a pure web application.
Note that because this implementation relies on the HttpSession, it is only functional in a
servlet container - it is not capable of supporting Sessions for any clients other than those using the HTTP
protocol.
Therefore, if you need Session support for heterogeneous clients (e.g. web browsers,
RMI clients, etc), use the DefaultWebSessionManager
instead. The DefaultWebSessionManager supports both traditional web-based access as well as non web-based
clients.DefaultWebSessionManager| Constructor and Description |
|---|
ServletContainerSessionManager() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.shiro.session.Session |
createSession(javax.servlet.http.HttpSession httpSession,
String host) |
protected org.apache.shiro.session.Session |
createSession(org.apache.shiro.session.mgt.SessionContext sessionContext) |
org.apache.shiro.session.Session |
getSession(org.apache.shiro.session.mgt.SessionKey key) |
boolean |
isServletContainerSessions()
This implementation always delegates to the servlet container for sessions, so this method returns
true always. |
org.apache.shiro.session.Session |
start(org.apache.shiro.session.mgt.SessionContext context) |
public org.apache.shiro.session.Session start(org.apache.shiro.session.mgt.SessionContext context)
throws org.apache.shiro.authz.AuthorizationException
start in interface org.apache.shiro.session.mgt.SessionManagerorg.apache.shiro.authz.AuthorizationExceptionpublic org.apache.shiro.session.Session getSession(org.apache.shiro.session.mgt.SessionKey key)
throws org.apache.shiro.session.SessionException
getSession in interface org.apache.shiro.session.mgt.SessionManagerorg.apache.shiro.session.SessionExceptionprotected org.apache.shiro.session.Session createSession(org.apache.shiro.session.mgt.SessionContext sessionContext)
throws org.apache.shiro.authz.AuthorizationException
org.apache.shiro.authz.AuthorizationExceptionprotected org.apache.shiro.session.Session createSession(javax.servlet.http.HttpSession httpSession,
String host)
public boolean isServletContainerSessions()
true always.isServletContainerSessions in interface WebSessionManagertrue alwaysCopyright © 2004–2017 The Apache Software Foundation. All rights reserved.