org.apache.shiro.web.session.mgt
Class ServletContainerSessionManager

java.lang.Object
  extended by org.apache.shiro.session.mgt.AbstractSessionManager
      extended by org.apache.shiro.web.session.mgt.ServletContainerSessionManager
All Implemented Interfaces:
SessionManager

public class ServletContainerSessionManager
extends AbstractSessionManager

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. I.e. it is NOT capable of supporting Sessions any clients other than HttpRequest/HttpResponse based clients.

Therefore, if you need Session access from heterogenous client mediums (e.g. web pages, Flash applets, Java Web Start applications, etc.), use the DefaultWebSessionManager instead. The DefaultWebSessionManager supports both traditional web-based access as well as non web-based clients.

Since:
0.9

Field Summary
 
Fields inherited from class org.apache.shiro.session.mgt.AbstractSessionManager
DEFAULT_GLOBAL_SESSION_TIMEOUT, MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_SECOND
 
Constructor Summary
ServletContainerSessionManager()
           
 
Method Summary
protected  Session createSession(HttpSession httpSession, String host)
           
protected  Session createSession(SessionContext sessionContext)
           
 Session getSession(SessionKey key)
           
 Session start(SessionContext context)
           
 
Methods inherited from class org.apache.shiro.session.mgt.AbstractSessionManager
getGlobalSessionTimeout, setGlobalSessionTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletContainerSessionManager

public ServletContainerSessionManager()
Method Detail

start

public Session start(SessionContext context)
              throws AuthorizationException
Throws:
AuthorizationException

getSession

public Session getSession(SessionKey key)
                   throws SessionException
Throws:
SessionException

createSession

protected Session createSession(SessionContext sessionContext)
                         throws AuthorizationException
Throws:
AuthorizationException
Since:
1.0

createSession

protected Session createSession(HttpSession httpSession,
                                String host)


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.