GigaSpaces XAP 9.5 API

org.openspaces.jee.sessions.jetty
Class GigaSessionManager

java.lang.Object
  extended by org.eclipse.jetty.util.component.AbstractLifeCycle
      extended by org.eclipse.jetty.server.session.AbstractSessionManager
          extended by org.openspaces.jee.sessions.jetty.GigaSessionManager
All Implemented Interfaces:
org.eclipse.jetty.server.SessionManager, org.eclipse.jetty.util.component.LifeCycle

public class GigaSessionManager
extends org.eclipse.jetty.server.session.AbstractSessionManager

GigaspacesSessionManager A Jetty SessionManager where the session data is stored in a data grid "cloud". On each request, the session data is looked up in the "cloud" and brought into the local space cache if doesn't already exist, and an entry put into the managers map of sessions. When the request exists, any changes, including changes to the access time of the session are written back out to the grid.


Nested Class Summary
 class GigaSessionManager.Session
          Session A session in memory of a Context.
 
Nested classes/interfaces inherited from class org.eclipse.jetty.server.session.AbstractSessionManager
org.eclipse.jetty.server.session.AbstractSessionManager.SessionIf
 
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
 
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener
 
Field Summary
protected  long _savePeriodMs
           
protected  int _scavengeCount
           
protected  long _scavengePeriodMs
           
 
Fields inherited from class org.eclipse.jetty.server.session.AbstractSessionManager
__defaultSessionTrackingModes, __distantFuture, _checkingRemoteSessionIdEncoding, _context, _dftMaxIdleSecs, _httpOnly, _loader, _maxCookieAge, _nodeIdInSessionId, _refreshCookieAge, _secureCookies, _secureRequestOnly, _sessionAttributeListeners, _sessionComment, _sessionCookie, _sessionDomain, _sessionHandler, _sessionIdManager, _sessionIdPathParameterName, _sessionIdPathParameterNamePrefix, _sessionListeners, _sessionPath, _sessionsStats, _sessionTimeStats, _sessionTrackingModes, SESSION_KNOWN_ONLY_TO_AUTHENTICATED
 
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
Fields inherited from interface org.eclipse.jetty.server.SessionManager
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
 
Constructor Summary
GigaSessionManager()
           
 
Method Summary
protected  void add(SessionData data)
           
protected  void addSession(org.eclipse.jetty.server.session.AbstractSession abstractSession)
           
protected  boolean delete(String id)
           
 void doStart()
          Start the session manager.
 void doStop()
          Stop the session manager.
protected  SessionData fetch(String sessionId)
           
protected  Object[] findExpiredSessions(long timestamp)
           
 BeanLevelProperties getBeanLevelProperties()
           
 ClusterInfo getClusterInfo()
           
 int getSavePeriod()
          How often an actual update of the session will be performed to the Space.
 int getScavengePeriod()
          How often the scavenger thread will run in order to check for expired sessions.
 GigaSessionManager.Session getSession(String idInCluster)
          Get a session matching the id.
 Map getSessionMap()
           
 int getSessions()
           
 IJSpace getSpace()
           
 String getSpaceUrl()
           
 void invalidateSession(String idInCluster)
           
protected  void invalidateSessions()
           
protected  org.eclipse.jetty.server.session.AbstractSession newSession(javax.servlet.http.HttpServletRequest request)
           
 void removeSession(org.eclipse.jetty.server.session.AbstractSession abstractSession, boolean invalidate)
           
protected  boolean removeSession(String idInCluster)
           
 void resetStats()
           
protected  void scavenge()
          Look for expired sessions that we know about in our session map, and double check with the grid that it has really expired, or already been removed.
 void setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
           
 void setClusterInfo(ClusterInfo clusterInfo)
           
 void setCountSessionPeriod(int seconds)
           
 void setLease(long lease)
          The lease of the SessionData that is written to the Space.
 void setSavePeriod(int seconds)
          How often an actual update of the session will be performed to the Space.
 void setScavengePeriod(int seconds)
          How often the scavenger thread will run in order to check for expired sessions.
 void setSpace(IJSpace space)
           
 void setSpaceUrl(String url)
           
protected  void update(SessionData data)
           
 
Methods inherited from class org.eclipse.jetty.server.session.AbstractSessionManager
access, addEventListener, addSession, clearEventListeners, complete, doSessionAttributeListeners, getClusterId, getContext, getContextHandler, getDefaultSessionTrackingModes, getEffectiveSessionTrackingModes, getHttpOnly, getHttpSession, getIdManager, getMaxCookieAge, getMaxInactiveInterval, getMaxSessions, getMetaManager, getMinSessions, getNodeId, getRefreshCookieAge, getSecureCookies, getSessionCookie, getSessionCookie, getSessionCookieConfig, getSessionDomain, getSessionHandler, getSessionIdManager, getSessionIdPathParameterName, getSessionIdPathParameterNamePrefix, getSessionPath, getSessionsMax, getSessionsTotal, getSessionTimeMax, getSessionTimeMean, getSessionTimeStdDev, getSessionTimeTotal, isCheckingRemoteSessionIdEncoding, isNodeIdInSessionId, isSecureRequestOnly, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, removeSession, renewSession, setCheckingRemoteSessionIdEncoding, setHttpOnly, setIdManager, setMaxInactiveInterval, setNodeIdInSessionId, setRefreshCookieAge, setSecureRequestOnly, setSessionCookie, setSessionHandler, setSessionIdManager, setSessionIdPathParameterName, setSessionTrackingModes, setUsingCookies, statsReset
 
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, 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.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

Field Detail

_scavengePeriodMs

protected long _scavengePeriodMs

_scavengeCount

protected int _scavengeCount

_savePeriodMs

protected long _savePeriodMs
Constructor Detail

GigaSessionManager

public GigaSessionManager()
Method Detail

doStart

public void doStart()
             throws Exception
Start the session manager.

Overrides:
doStart in class org.eclipse.jetty.server.session.AbstractSessionManager
Throws:
Exception

doStop

public void doStop()
            throws Exception
Stop the session manager.

Overrides:
doStop in class org.eclipse.jetty.server.session.AbstractSessionManager
Throws:
Exception

getSavePeriod

public int getSavePeriod()
How often an actual update of the session will be performed to the Space. Set in seconds and defaults to 60 seconds.


setSavePeriod

public void setSavePeriod(int seconds)
How often an actual update of the session will be performed to the Space. Set in seconds and defaults to 60 seconds.


getScavengePeriod

public int getScavengePeriod()
How often the scavenger thread will run in order to check for expired sessions. Set in seconds and defaults to 60 * 5 seconds (5 minutes).


setScavengePeriod

public void setScavengePeriod(int seconds)
How often the scavenger thread will run in order to check for expired sessions. Set in seconds and defaults to 60 * 5 seconds (5 minutes).


setCountSessionPeriod

public void setCountSessionPeriod(int seconds)

setSpace

public void setSpace(IJSpace space)

getSpace

public IJSpace getSpace()

setSpaceUrl

public void setSpaceUrl(String url)

getSpaceUrl

public String getSpaceUrl()

getClusterInfo

public ClusterInfo getClusterInfo()

setClusterInfo

public void setClusterInfo(ClusterInfo clusterInfo)

getBeanLevelProperties

public BeanLevelProperties getBeanLevelProperties()

setBeanLevelProperties

public void setBeanLevelProperties(BeanLevelProperties beanLevelProperties)

setLease

public void setLease(long lease)
The lease of the SessionData that is written to the Space. Set in seconds and defaults to FOREVER.


getSession

public GigaSessionManager.Session getSession(String idInCluster)
Get a session matching the id. Look in the grid to see if such a session exists, as it may have moved from another node.

Specified by:
getSession in class org.eclipse.jetty.server.session.AbstractSessionManager

getSessionMap

public Map getSessionMap()
Overrides:
getSessionMap in class org.eclipse.jetty.server.session.AbstractSessionManager

getSessions

public int getSessions()
Overrides:
getSessions in class org.eclipse.jetty.server.session.AbstractSessionManager

resetStats

public void resetStats()
Overrides:
resetStats in class org.eclipse.jetty.server.session.AbstractSessionManager

invalidateSessions

protected void invalidateSessions()
Specified by:
invalidateSessions in class org.eclipse.jetty.server.session.AbstractSessionManager

newSession

protected org.eclipse.jetty.server.session.AbstractSession newSession(javax.servlet.http.HttpServletRequest request)
Specified by:
newSession in class org.eclipse.jetty.server.session.AbstractSessionManager

removeSession

protected boolean removeSession(String idInCluster)
Specified by:
removeSession in class org.eclipse.jetty.server.session.AbstractSessionManager

removeSession

public void removeSession(org.eclipse.jetty.server.session.AbstractSession abstractSession,
                          boolean invalidate)
Overrides:
removeSession in class org.eclipse.jetty.server.session.AbstractSessionManager

invalidateSession

public void invalidateSession(String idInCluster)

addSession

protected void addSession(org.eclipse.jetty.server.session.AbstractSession abstractSession)
Specified by:
addSession in class org.eclipse.jetty.server.session.AbstractSessionManager

scavenge

protected void scavenge()
Look for expired sessions that we know about in our session map, and double check with the grid that it has really expired, or already been removed.


add

protected void add(SessionData data)
            throws Exception
Throws:
Exception

delete

protected boolean delete(String id)
                  throws Exception
Throws:
Exception

update

protected void update(SessionData data)
               throws Exception
Throws:
Exception

fetch

protected SessionData fetch(String sessionId)
                     throws Exception
Throws:
Exception

findExpiredSessions

protected Object[] findExpiredSessions(long timestamp)
                                throws Exception
Throws:
Exception

GigaSpaces XAP 9.5 API

Copyright © GigaSpaces.