WebObjects 5.2.3

com.webobjects.jspservlet
Class WOServletSessionStore

java.lang.Object
  extended bycom.webobjects.appserver.WOSessionStore
      extended bycom.webobjects.jspservlet.WOServletSessionStore

public class WOServletSessionStore
extends WOSessionStore

This is a subclass of WOSessionStore, and is intended to replace the WOServerSessionStore subclass. The intention is that WOSessions will be piggybacked on HttpSession objects from the JSP/Servlet world. As they expire, so will the WOSessions. If they are serialized and moved to another container, the WOSession should follow it -- however, this functionality may not be completed. Because of this, this session store does not actually store sessions. Instead, it knows how to add/remove sessions to/from existing JSP sessions. One consequence is that the WOSessionTimeout setting is no longer applicable, as the JSP session setting will be used instead.


Constructor Summary
WOServletSessionStore()
          Creates a default session object.
 
Method Summary
 WOSession removeSessionWithID(String sessionID)
          Removes a WOSession instance from storage in order to make it eligible for garbage collection.
 WOSession restoreSessionWithID(String sessionID, WORequest woRequest)
          Restores a WOSession associated with sessionID from storage.
 void saveSessionForContext(WOContext context)
          Saves the current WOSession in context into storage.
static WOSession woSessionFromHttpSession(javax.servlet.http.HttpSession anHttpSession)
          Returns the WOSession associated with anHttpSession.
 
Methods inherited from class com.webobjects.appserver.WOSessionStore
checkInSessionForContext, checkOutSessionWithID, finalize, serverSessionStore
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WOServletSessionStore

public WOServletSessionStore()
Creates a default session object.

Method Detail

removeSessionWithID

public WOSession removeSessionWithID(String sessionID)
Description copied from class: WOSessionStore
Removes a WOSession instance from storage in order to make it eligible for garbage collection.

This method should be implemented by concrete WOSessionStore subclasses.

Specified by:
removeSessionWithID in class WOSessionStore
Parameters:
sessionID - the session id associated with the WOSession to be removed
Returns:
the specified WOSession if found; null otherwise

restoreSessionWithID

public WOSession restoreSessionWithID(String sessionID,
                                      WORequest woRequest)
Description copied from class: WOSessionStore
Restores a WOSession associated with sessionID from storage. This method is called from checkOutSessionWithID and is to be implemented by a concrete WOSessionStore subclass. The subclass is free to decide on the kind of suitable storage and the algorithm for restoration.

The default implementation does nothing.

Specified by:
restoreSessionWithID in class WOSessionStore
Parameters:
sessionID - the session id associated with the WOSession to be restored
woRequest - the input HTTP request for session restoration
Returns:
a restored WOSession if found; null otherwise
See Also:
WOSessionStore.checkOutSessionWithID(String, WORequest)

saveSessionForContext

public void saveSessionForContext(WOContext context)
Description copied from class: WOSessionStore
Saves the current WOSession in context into storage. This method is called from checkInSessionForContext and is to implemented by a concrete WOSessionStore subclass. The subclass is free to decided on the kind of suitable storage and the algorithm for saving.

The default implementation does nothing.

Specified by:
saveSessionForContext in class WOSessionStore
Parameters:
context - the WOContext to retrieve the current session to be saved
See Also:
WOSessionStore.checkInSessionForContext(WOContext)

woSessionFromHttpSession

public static WOSession woSessionFromHttpSession(javax.servlet.http.HttpSession anHttpSession)
Returns the WOSession associated with anHttpSession. If anHttpSession is null, or has no associated WOSession, this method returns null.

Parameters:
anHttpSession - the HttpSession object (this is the JSP session object).
Returns:
WOSession the WOSession associated with this HttpSession

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.