org.eclipse.jetty.server.session
类 HashSessionManager

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.server.session.AbstractSessionManager
          继承者 org.eclipse.jetty.server.session.HashSessionManager
所有已实现的接口:
SessionManager, LifeCycle

public class HashSessionManager
extends AbstractSessionManager

HashSessionManager An in-memory implementation of SessionManager.

This manager supports saving sessions to disk, either periodically or at shutdown. Sessions can also have their content idle saved to disk to reduce the memory overheads of large idle sessions.

This manager will create it's own Timer instance to scavenge threads, unless it discovers a shared Timer instance set as the "org.eclipse.jetty.server.session.timer" attribute of the ContextHandler.


嵌套类摘要
protected  class HashSessionManager.ClassLoadingObjectInputStream
           
 
从类 org.eclipse.jetty.server.session.AbstractSessionManager 继承的嵌套类/接口
AbstractSessionManager.SessionIf
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
protected  ConcurrentMap<String,HashedSession> _sessions
           
 
从类 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
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
从接口 org.eclipse.jetty.server.SessionManager 继承的字段
__CheckRemoteSessionEncoding, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
 
构造方法摘要
HashSessionManager()
           
 
方法摘要
protected  void addSession(AbstractSession session)
           
 void doStart()
           
 void doStop()
           
 int getIdleSavePeriod()
           
 int getSavePeriod()
           
 int getScavengePeriod()
           
 AbstractSession getSession(String idInCluster)
          Get a known existing session
 int getSessions()
           
 File getStoreDirectory()
           
protected  void invalidateSessions()
           
 boolean isDeleteUnrestorableSessions()
           
 boolean isLazyLoad()
           
protected  AbstractSession newSession(HttpServletRequest request)
          Create a new session instance
protected  AbstractSession newSession(long created, long accessed, String clusterId)
           
protected  boolean removeSession(String clusterId)
           
 HashedSession restoreSession(InputStream is, HashedSession session)
           
protected  HashedSession restoreSession(String idInCuster)
           
 void restoreSessions()
           
 void saveSessions(boolean reactivate)
           
protected  void scavenge()
          Find sessions that have timed out and invalidate them.
 void setDeleteUnrestorableSessions(boolean deleteUnrestorableSessions)
           
 void setIdleSavePeriod(int seconds)
          Configures the period in seconds after which a session is deemed idle and saved to save on session memory.
 void setLazyLoad(boolean lazyLoad)
           
 void setMaxInactiveInterval(int seconds)
          Sets the max period of inactivity, after which the session is invalidated, in seconds.
 void setSavePeriod(int seconds)
           
 void setScavengePeriod(int seconds)
           
 void setStoreDirectory(File dir)
           
 
从类 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, getSessionMap, getSessionPath, getSessionsMax, getSessionsTotal, getSessionTimeMax, getSessionTimeMean, getSessionTimeStdDev, getSessionTimeTotal, isCheckingRemoteSessionIdEncoding, isNodeIdInSessionId, isSecureRequestOnly, isUsingCookies, isUsingURLs, isValid, newHttpSession, removeEventListener, removeSession, removeSession, renewSession, resetStats, setCheckingRemoteSessionIdEncoding, setHttpOnly, setIdManager, setNodeIdInSessionId, setRefreshCookieAge, setSecureRequestOnly, setSessionCookie, setSessionHandler, setSessionIdManager, setSessionIdPathParameterName, setSessionTrackingModes, setUsingCookies, statsReset
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的方法
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

字段详细信息

_sessions

protected final ConcurrentMap<String,HashedSession> _sessions
构造方法详细信息

HashSessionManager

public HashSessionManager()
方法详细信息

doStart

public void doStart()
             throws Exception
覆盖:
AbstractSessionManager 中的 doStart
抛出:
Exception
另请参见:
org.eclipse.jetty.servlet.AbstractSessionManager#doStart()

doStop

public void doStop()
            throws Exception
覆盖:
AbstractSessionManager 中的 doStop
抛出:
Exception
另请参见:
org.eclipse.jetty.servlet.AbstractSessionManager#doStop()

getScavengePeriod

public int getScavengePeriod()
返回:
the period in seconds at which a check is made for sessions to be invalidated.

getSessions

public int getSessions()
覆盖:
AbstractSessionManager 中的 getSessions

getIdleSavePeriod

public int getIdleSavePeriod()
返回:
seconds Idle period after which a session is saved

setIdleSavePeriod

public void setIdleSavePeriod(int seconds)
Configures the period in seconds after which a session is deemed idle and saved to save on session memory. The session is persisted, the values attribute map is cleared and the session set to idled.

参数:
seconds - Idle period after which a session is saved

setMaxInactiveInterval

public void setMaxInactiveInterval(int seconds)
从接口 SessionManager 复制的描述
Sets the max period of inactivity, after which the session is invalidated, in seconds.

指定者:
接口 SessionManager 中的 setMaxInactiveInterval
覆盖:
AbstractSessionManager 中的 setMaxInactiveInterval
参数:
seconds - the max inactivity period, in seconds.
另请参见:
SessionManager.getMaxInactiveInterval()

setSavePeriod

public void setSavePeriod(int seconds)
参数:
seconds - the period is seconds at which sessions are periodically saved to disk

getSavePeriod

public int getSavePeriod()
返回:
the period in seconds at which sessions are periodically saved to disk

setScavengePeriod

public void setScavengePeriod(int seconds)
参数:
seconds - the period in seconds at which a check is made for sessions to be invalidated.

scavenge

protected void scavenge()
Find sessions that have timed out and invalidate them. This runs in the SessionScavenger thread.


addSession

protected void addSession(AbstractSession session)
指定者:
AbstractSessionManager 中的 addSession

getSession

public AbstractSession getSession(String idInCluster)
从类 AbstractSessionManager 复制的描述
Get a known existing session

指定者:
AbstractSessionManager 中的 getSession
参数:
idInCluster - The session ID in the cluster, stripped of any worker name.
返回:
A Session or null if none exists.

invalidateSessions

protected void invalidateSessions()
                           throws Exception
指定者:
AbstractSessionManager 中的 invalidateSessions
抛出:
Exception

newSession

protected AbstractSession newSession(HttpServletRequest request)
从类 AbstractSessionManager 复制的描述
Create a new session instance

指定者:
AbstractSessionManager 中的 newSession
返回:
the new session

newSession

protected AbstractSession newSession(long created,
                                     long accessed,
                                     String clusterId)

removeSession

protected boolean removeSession(String clusterId)
指定者:
AbstractSessionManager 中的 removeSession

setStoreDirectory

public void setStoreDirectory(File dir)
                       throws IOException
抛出:
IOException

getStoreDirectory

public File getStoreDirectory()

setLazyLoad

public void setLazyLoad(boolean lazyLoad)

isLazyLoad

public boolean isLazyLoad()

isDeleteUnrestorableSessions

public boolean isDeleteUnrestorableSessions()

setDeleteUnrestorableSessions

public void setDeleteUnrestorableSessions(boolean deleteUnrestorableSessions)

restoreSessions

public void restoreSessions()
                     throws Exception
抛出:
Exception

restoreSession

protected HashedSession restoreSession(String idInCuster)

saveSessions

public void saveSessions(boolean reactivate)
                  throws Exception
抛出:
Exception

restoreSession

public HashedSession restoreSession(InputStream is,
                                    HashedSession session)
                             throws Exception
抛出:
Exception


Copyright © 2013. All Rights Reserved.