org.barracudamvc.plankton.http
Class SessionManager

java.lang.Object
  extended byorg.barracudamvc.plankton.http.SessionManager

public class SessionManager
extends Object

This class provides a convenient bridge to any sessions which are being managed/registered through Barracuda's SessionObjectRepository class (ie. all events that go through ApplicationGateway use this). You can use this class to get a handle to all the underlying sessions, to log an individual session out, or to log all sessions out.

Since:
//csc_011704_1
Author:
christianc@granitepeaks.com

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
SessionManager()
           
 
Method Summary
static SoftHashMap getAllSessions()
          get a Map containing soft references to all the HttpSessions.
static javax.servlet.http.HttpSession getSession(String sessionID)
          allows you to look up a session by its unique identifier.
static void invalidateAllSessions()
          allows you to invalidate all sessions.
static void invalidateSession()
          allows you to invalidate a session associated with the current thread
static void invalidateSession(String sessionID)
          allows you to invalidate a session by its unique identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

SessionManager

public SessionManager()
Method Detail

getSession

public static javax.servlet.http.HttpSession getSession(String sessionID)
allows you to look up a session by its unique identifier. You should only need to call this if you are performing large scale session management (ie. logging out all users, etc)


getAllSessions

public static SoftHashMap getAllSessions()
get a Map containing soft references to all the HttpSessions. Simply delegates to ObjectRepository.getRawSessionStore(). Note that you should be very careful using this method - the ObjectRespository stores soft references to the session, allowing them to be recalimed by the garbage collector when they expire. If you use this method to access the underlying sessions you must be very careful not to hold onto these references or you may run into problems.


invalidateSession

public static void invalidateSession()
allows you to invalidate a session associated with the current thread


invalidateSession

public static void invalidateSession(String sessionID)
allows you to invalidate a session by its unique identifier. You should only need to call this if you are performing large scale session management (ie. logging out all users, etc)


invalidateAllSessions

public static void invalidateAllSessions()
allows you to invalidate all sessions. You should only need to call this if you are performing large scale session management (ie. logging out all users, etc)



Copyright © 2004 BarracudaMVC.org All Rights Reserved.