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.
| 从类 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.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 |
_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.