Top Description Inners Fields Constructors Methods
org.mortbay.jetty.servlet

public abstract Class AbstractSessionManager

extends AbstractLifeCycle
implements SessionManager
Class Inheritance
All Implemented Interfaces
org.mortbay.jetty.SessionManager, org.mortbay.component.LifeCycle
Known Direct Subclasses
org.mortbay.jetty.servlet.HashSessionManager
Imports
java.io.Serializable, java.util.ArrayList, .Collections, .Enumeration, .EventListener, .Iterator, .List, .Map, javax.servlet.ServletContext, javax.servlet.http.Cookie, .HttpServletRequest, .HttpSession, .HttpSessionActivationListener, .HttpSessionAttributeListener, .HttpSessionBindingEvent, .HttpSessionBindingListener, .HttpSessionContext, .HttpSessionEvent, .HttpSessionListener, org.mortbay.component.AbstractLifeCycle, org.mortbay.jetty.HttpOnlyCookie, .Server, .SessionIdManager, .SessionManager, org.mortbay.jetty.handler.ContextHandler, org.mortbay.util.LazyList

An Abstract implementation of SessionManager. The partial implementation of SessionManager interface provides the majority of the handling required to implement a SessionManager. Concrete implementations of SessionManager based on AbstractSessionManager need only implement the newSession method to return a specialized version of the Session inner class that provides an attribute Map.

If the property org.mortbay.jetty.servlet.AbstractSessionManager.23Notifications is set to true, the 2.3 servlet spec notification style will be used.

Author
Greg Wilkins (gregw)

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AbstractSessionManager.NullSessionContext

Deprecated as a consequence of HttpSessionContext being deprecated.
Null returning implementation of HttpSessionContext
public abstract class
public static interface
AbstractSessionManager.SessionIf

Interface that any session wrapper should implement so that SessionManager may access the Jetty session implementation.

Field Summary

Modifier and TypeField and Description
public static final int
private static final HttpSessionContext
__nullSessionContext

Deprecated as a consequence of HttpSessionContext being deprecated.
protected ContextHandler.SContext
protected int
protected boolean
protected ClassLoader
protected int
protected int
protected int
protected boolean
protected int
protected boolean
protected Object
protected String
protected String
protected SessionHandler
protected SessionIdManager
protected Object
protected String
protected String
protected String
private boolean
Inherited from org.mortbay.component.AbstractLifeCycle:
_listeners

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Cookie
access(HttpSession session, boolean secure)

Implements org.mortbay.jetty.SessionManager.access.

Called by the SessionHandler when a session is access by a request
public void
addEventListener(EventListener
An Event Listener. Individual SessionManagers implemetations may accept arbitrary listener types, but they are expected to at least handle HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener, HttpSessionListener
listener
)

Implements org.mortbay.jetty.SessionManager.addEventListener.

Add an event listener.
protected abstract void
protected void
addSession(AbstractSessionManager.Session session, boolean created)

Add the session Registers the session with this manager and registers the session ID with the sessionIDManager;

public void
public void
complete(HttpSession session)

Implements org.mortbay.jetty.SessionManager.complete.

Called by the SessionHandler when a reqeuest is not longer handling a session.
public void
public void
public String
getClusterId(HttpSession session)

Implements org.mortbay.jetty.SessionManager.getClusterId.

Get the session cluster id
public boolean

Returns:

Returns the httpOnly.
getHttpOnly
()

Implements org.mortbay.jetty.SessionManager.getHttpOnly.

public HttpSession
public SessionIdManager

Returns:

Returns the metaManager used for cross context session management
getIdManager
()

Implements org.mortbay.jetty.SessionManager.getIdManager.

public int
public int
public int
public SessionIdManager
public int
public String
getNodeId(HttpSession session)

Implements org.mortbay.jetty.SessionManager.getNodeId.

Get the session node id
public int
public boolean

Returns:

Returns the secureCookies.
getSecureCookies
()

Implements org.mortbay.jetty.SessionManager.getSecureCookies.

public abstract AbstractSessionManager.Session

Returns:

A Session or null if none exists.
getSession
(String
The session ID in the cluster, stripped of any worker name.
idInCluster
)

Get a known existingsession

public String
public Cookie
getSessionCookie(HttpSession
The session to which the cookie should refer.
session
,
String
The context to which the cookie should be linked. The client will only send the cookie value when requesting resources under this path.
contextPath
,
boolean
Whether the client is accessing the server over a secure protocol (i.e. HTTPS).
requestIsSecure
)

Implements org.mortbay.jetty.SessionManager.getSessionCookie.

Get a Cookie for a session.
public String
public SessionHandler

Returns:

Returns the sessionHandler.
getSessionHandler
()

public abstract Map<K, V>
getSessionMap()

Deprecated Need to review if it is needed.
public String
public abstract int
public String
public String
protected abstract void
public boolean

Returns:

true if the cluster node id (worker id) is returned as part of the session id by HttpSession#getId(). Default is false.
isNodeIdInSessionId
()

public boolean

Returns:

Returns the usingCookies.
isUsingCookies
()

Implements org.mortbay.jetty.SessionManager.isUsingCookies.

public boolean
public HttpSession
newHttpSession(HttpServletRequest request)

Implements org.mortbay.jetty.SessionManager.newHttpSession.

Create a new HttpSession for a request
protected abstract AbstractSessionManager.Session
newSession(HttpServletRequest request)

Create a new session instance

public void
public void
removeSession(HttpSession
The session to remove
session
,
boolean invalidate)

Remove session from manager

public void
removeSession(AbstractSessionManager.Session
The session to remove
session
,
boolean invalidate)

Remove session from manager

protected abstract void
removeSession(String idInCluster)

public void
public void
setHttpOnly(boolean
The httpOnly to set.
httpOnly
)

public void
setIdManager(SessionIdManager
The metaManager used for cross context session management.
metaManager
)

Implements org.mortbay.jetty.SessionManager.setIdManager.

public void
public void
public void
public void
setNodeIdInSessionId(boolean
true if the cluster node id (worker id) will be returned as part of the session id by HttpSession#getId(). Default is false.
nodeIdInSessionId
)

public void
setRefreshCookieAge(int ageInSeconds)

public void
setSecureCookies(boolean
The secureCookies to set.
secureCookies
)

public void
public void
public void
setSessionHandler(SessionHandler
The sessionHandler to set.
sessionHandler
)

Implements org.mortbay.jetty.SessionManager.setSessionHandler.

public void
public void
setSessionURL(String
The parameter name for session id URL rewriting (null or "none" for no rewriting).
param
)

Implements org.mortbay.jetty.SessionManager.setSessionURL.

Set the session ID URL parameter name
public void
setUsingCookies(boolean
The usingCookies to set.
usingCookies
)

Inherited from org.mortbay.component.AbstractLifeCycle:
addLifeCycleListenerisFailedisRunningisStartedisStartingisStoppedisStoppingremoveLifeCycleListenerstartstop