All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface org.apache.tomcat.core.SessionManager

public interface SessionManager
Author:
Craig R. McClanahan, costin@dnt.ro, Gal Shachor shachor@il.ibm.com

Method Index

 o accessed(Context, Request, String)
Will mark the session lastAccess time.
 o createSession(Context)
Construct and return a new session object, based on the default settings specified by this Manager's properties.
 o findSession(Context, String)
Return the active Session, associated with this Manager, with the specified session id (if any); otherwise return null.
 o removeSessions(Context)
Used by context when stoped, need to remove all sessions used by that context
 o setSessionTimeOut(int)
Used by context to configure the session manager's inactivity timeout.

Methods

 o createSession
 public abstract HttpSession createSession(Context ctx)
Construct and return a new session object, based on the default settings specified by this Manager's properties. The session id will be assigned by this method, and available via the getId() method of the returned session. If a new session cannot be created for any reason, return null.

Parameters:
ctx - The session will be created for the specified context
Throws: IllegalStateException
if a new session cannot be instantiated for any reason
 o accessed
 public abstract void accessed(Context ctx,
                               Request req,
                               String id)
Will mark the session lastAccess time. Will be called for each request that has a valid sessionId A simple SessionManager will just use the id, a complex manager may use the ctx and req to do additional work.

Parameters:
ctx - the context where the request belong
req - the request having the id
 o findSession
 public abstract HttpSession findSession(Context ctx,
                                         String id)
Return the active Session, associated with this Manager, with the specified session id (if any); otherwise return null.

Parameters:
id - The session id for the session to be returned
ctx - The session needs to belong to the context
Throws: ClassNotFoundException
if a deserialization error occurs while processing this request
Throws: IllegalStateException
if a new session cannot be instantiated for any reason
 o removeSessions
 public abstract void removeSessions(Context ctx)
Used by context when stoped, need to remove all sessions used by that context

 o setSessionTimeOut
 public abstract void setSessionTimeOut(int minutes)
Used by context to configure the session manager's inactivity timeout. The SessionManager may have some default session time out, the Context on the other hand has it's timeout set by the deployment descriptor (web.xml). This method lets the Context conforgure the session manager according to this value.

Parameters:
minutes - The session inactivity timeout in minutes.

All Packages  Class Hierarchy  This Package  Previous  Next  Index