org.mortbay.cometd.session
Class BayeuxSessionManager

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.servlet.AbstractSessionManager
          extended by org.mortbay.jetty.servlet.HashSessionManager
              extended by org.mortbay.cometd.session.BayeuxSessionManager
All Implemented Interfaces:
LifeCycle, SessionManager

public class BayeuxSessionManager
extends HashSessionManager

This is an experimental session manager that uses Bayeux to send replicated session data to the client, that can be made available if the client switches nodes in a cluster. Care must be taken when handling requests that do not have sessions, so that new sessions are not created. Session should be created/restored by the bayeux handshake. The client side needs to add in the dojox.cometd.session extension.

Author:
gregw

Nested Class Summary
protected  class BayeuxSessionManager.BayeuxSession
           
protected  class BayeuxSessionManager.SessionExt
           
 
Nested classes/interfaces inherited from class org.mortbay.jetty.servlet.HashSessionManager
HashSessionManager.ClassLoadingObjectInputStream, HashSessionManager.Session
 
Nested classes/interfaces inherited from class org.mortbay.jetty.servlet.AbstractSessionManager
AbstractSessionManager.NullSessionContext, AbstractSessionManager.SessionIf
 
Field Summary
static String BAYEUX_SESSION
           
 
Fields inherited from class org.mortbay.jetty.servlet.HashSessionManager
_sessions
 
Fields inherited from class org.mortbay.jetty.servlet.AbstractSessionManager
__distantFuture, _context, _dftMaxIdleSecs, _httpOnly, _loader, _maxCookieAge, _maxSessions, _minSessions, _nodeIdInSessionId, _refreshCookieAge, _secureCookies, _sessionAttributeListeners, _sessionCookie, _sessionDomain, _sessionHandler, _sessionIdManager, _sessionListeners, _sessionPath, _sessionURL, _sessionURLPrefix
 
Fields inherited from interface org.mortbay.jetty.SessionManager
__DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionURL, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionPathProperty, __SessionURLProperty
 
Constructor Summary
BayeuxSessionManager()
           
 
Method Summary
 void doStart()
           
protected  void initialize(dojox.cometd.Bayeux bayeux)
           
protected  AbstractSessionManager.Session newSession(HttpServletRequest request)
          Create a new session instance
protected  AbstractSessionManager.Session newSession(long created, String clusterId)
           
 
Methods inherited from class org.mortbay.jetty.servlet.HashSessionManager
addSession, doStop, getSavePeriod, getScavengePeriod, getSession, getSessionMap, getSessions, getStoreDirectory, invalidateSessions, removeSession, restoreSession, restoreSessions, saveSessions, setMaxInactiveInterval, setSavePeriod, setScavengePeriod, setStoreDirectory
 
Methods inherited from class org.mortbay.jetty.servlet.AbstractSessionManager
access, addEventListener, addSession, clearEventListeners, complete, getClusterId, getHttpOnly, getHttpSession, getIdManager, getMaxCookieAge, getMaxInactiveInterval, getMaxSessions, getMetaManager, getMinSessions, getNodeId, getRefreshCookieAge, getSecureCookies, getSessionCookie, getSessionCookie, getSessionDomain, getSessionHandler, getSessionPath, getSessionURL, getSessionURLPrefix, isNodeIdInSessionId, isUsingCookies, isValid, newHttpSession, removeEventListener, removeSession, removeSession, resetStats, setHttpOnly, setIdManager, setMaxCookieAge, setMetaManager, setNodeIdInSessionId, setRefreshCookieAge, setSecureCookies, setSessionCookie, setSessionDomain, setSessionHandler, setSessionPath, setSessionURL, setUsingCookies
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
 

Field Detail

BAYEUX_SESSION

public static final String BAYEUX_SESSION
See Also:
Constant Field Values
Constructor Detail

BayeuxSessionManager

public BayeuxSessionManager()
Method Detail

initialize

protected void initialize(dojox.cometd.Bayeux bayeux)

newSession

protected AbstractSessionManager.Session newSession(HttpServletRequest request)
Description copied from class: AbstractSessionManager
Create a new session instance

Overrides:
newSession in class HashSessionManager
Returns:

newSession

protected AbstractSessionManager.Session newSession(long created,
                                                    String clusterId)
Overrides:
newSession in class HashSessionManager

doStart

public void doStart()
             throws Exception
Overrides:
doStart in class HashSessionManager
Throws:
Exception


Copyright © 2008 Mort Bay Consulting. All Rights Reserved.