Package org.apache.shiro.web.session.mgt
Class ServletContainerSessionManager
- java.lang.Object
-
- org.apache.shiro.web.session.mgt.ServletContainerSessionManager
-
- All Implemented Interfaces:
org.apache.shiro.session.mgt.SessionManager,WebSessionManager
public class ServletContainerSessionManager extends Object implements WebSessionManager
SessionManager implementation providingSessionimplementations that are merely wrappers for the Servlet container'sHttpSession. 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 ShiroSessionManagerso it can be pluggable into a normal Shiro configuration in a pure web application. Note that because this implementation relies on theHttpSession, 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 needSessionsupport for heterogeneous clients (e.g. web browsers, RMI clients, etc), use theDefaultWebSessionManagerinstead. TheDefaultWebSessionManagersupports both traditional web-based access as well as non web-based clients.- Since:
- 0.9
- See Also:
DefaultWebSessionManager
-
-
Constructor Summary
Constructors Constructor Description ServletContainerSessionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.shiro.session.SessioncreateSession(javax.servlet.http.HttpSession httpSession, String host)protected org.apache.shiro.session.SessioncreateSession(org.apache.shiro.session.mgt.SessionContext sessionContext)org.apache.shiro.session.SessiongetSession(org.apache.shiro.session.mgt.SessionKey key)booleanisServletContainerSessions()This implementation always delegates to the servlet container for sessions, so this method returnstruealways.org.apache.shiro.session.Sessionstart(org.apache.shiro.session.mgt.SessionContext context)
-
-
-
Method Detail
-
start
public org.apache.shiro.session.Session start(org.apache.shiro.session.mgt.SessionContext context) throws org.apache.shiro.authz.AuthorizationException- Specified by:
startin interfaceorg.apache.shiro.session.mgt.SessionManager- Throws:
org.apache.shiro.authz.AuthorizationException
-
getSession
public org.apache.shiro.session.Session getSession(org.apache.shiro.session.mgt.SessionKey key) throws org.apache.shiro.session.SessionException- Specified by:
getSessionin interfaceorg.apache.shiro.session.mgt.SessionManager- Throws:
org.apache.shiro.session.SessionException
-
createSession
protected org.apache.shiro.session.Session createSession(org.apache.shiro.session.mgt.SessionContext sessionContext) throws org.apache.shiro.authz.AuthorizationException- Throws:
org.apache.shiro.authz.AuthorizationException- Since:
- 1.0
-
createSession
protected org.apache.shiro.session.Session createSession(javax.servlet.http.HttpSession httpSession, String host)
-
isServletContainerSessions
public boolean isServletContainerSessions()
This implementation always delegates to the servlet container for sessions, so this method returnstruealways.- Specified by:
isServletContainerSessionsin interfaceWebSessionManager- Returns:
truealways- Since:
- 1.2
-
-