org.apache.shiro.web.session.mgt
Class ServletContainerSessionManager
java.lang.Object
org.apache.shiro.web.session.mgt.ServletContainerSessionManager
- All Implemented Interfaces:
- SessionManager, WebSessionManager
public class ServletContainerSessionManager
- extends Object
- implements WebSessionManager
SessionManager implementation providing 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.
- Since:
- 0.9
- See Also:
DefaultWebSessionManager
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletContainerSessionManager
public ServletContainerSessionManager()
start
public Session start(SessionContext context)
throws AuthorizationException
- Specified by:
start in interface SessionManager
- Throws:
AuthorizationException
getSession
public Session getSession(SessionKey key)
throws SessionException
- Specified by:
getSession in interface SessionManager
- Throws:
SessionException
createSession
protected Session createSession(SessionContext sessionContext)
throws AuthorizationException
- Throws:
AuthorizationException- Since:
- 1.0
createSession
protected 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 returns
true always.
- Specified by:
isServletContainerSessions in interface WebSessionManager
- Returns:
true always- Since:
- 1.2
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.