|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.session.AbstractSessionManager
org.eclipse.jetty.server.session.JDBCSessionManager
public class JDBCSessionManager
JDBCSessionManager SessionManager that persists sessions to a database to enable clustering. Session data is persisted to the JettySessions table: rowId (unique in cluster: webapp name/path + virtualhost + sessionId) contextPath (of the context owning the session) sessionId (unique in a context) lastNode (name of node last handled session) accessTime (time in milliseconds session was accessed) lastAccessTime (previous time in milliseconds session was accessed) createTime (time in milliseconds session created) cookieTime (time in milliseconds session cookie created) lastSavedTime (last time in milliseconds session access times were saved) expiryTime (time in milliseconds that the session is due to expire) map (attribute map) As an optimization, to prevent thrashing the database, we do not persist the accessTime and lastAccessTime every time the session is accessed. Rather, we write it out every so often. The frequency is controlled by the saveIntervalSec field.
| 嵌套类摘要 | |
|---|---|
protected class |
JDBCSessionManager.ClassLoadingObjectInputStream
ClassLoadingObjectInputStream Used to persist the session attribute map |
class |
JDBCSessionManager.Session
Session Session instance. |
| 从类 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 JDBCSessionIdManager |
_jdbcSessionIdMgr
|
protected long |
_saveIntervalSec
|
| 从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段 |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| 构造方法摘要 | |
|---|---|
JDBCSessionManager()
|
|
| 方法摘要 | |
|---|---|
protected void |
addSession(AbstractSession session)
Add a newly created session to our in-memory list for this node and persist it. |
void |
cacheInvalidate(JDBCSessionManager.Session session)
A method that can be implemented in subclasses to support distributed caching of sessions. |
protected void |
deleteSession(JDBCSessionManager.Session data)
Delete a session from the database. |
void |
doStart()
Start the session manager. |
void |
doStop()
Stop the session manager. |
protected void |
expire(List<?> sessionIds)
Expire any Sessions we have in memory matching the list of expired Session ids. |
long |
getSaveInterval()
|
JDBCSessionManager.Session |
getSession(String idInCluster)
A session has been requested by its id on this node. |
int |
getSessions()
Get the number of sessions. |
protected void |
invalidateSession(String idInCluster)
Invalidate a session. |
protected void |
invalidateSessions()
|
protected JDBCSessionManager.Session |
loadSession(String id,
String canonicalContextPath,
String vhost)
Load a session from the database |
protected AbstractSession |
newSession(HttpServletRequest request)
Make a new Session. |
void |
removeSession(AbstractSession session,
boolean invalidate)
Remove session from manager |
protected boolean |
removeSession(String idInCluster)
Delete an existing session, both from the in-memory map and the database. |
void |
setSaveInterval(long sec)
Set the time in seconds which is the interval between saving the session access time to the database. |
protected void |
storeSession(JDBCSessionManager.Session session)
Insert a session into the database. |
protected void |
updateSession(JDBCSessionManager.Session data)
Update data on an existing persisted session. |
protected void |
updateSessionNode(JDBCSessionManager.Session data)
Update the node on which the session was last seen to be my node. |
| 从类 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 |
| 字段详细信息 |
|---|
protected JDBCSessionIdManager _jdbcSessionIdMgr
protected long _saveIntervalSec
| 构造方法详细信息 |
|---|
public JDBCSessionManager()
| 方法详细信息 |
|---|
public void setSaveInterval(long sec)
sec - public long getSaveInterval()
public void cacheInvalidate(JDBCSessionManager.Session session)
session - public JDBCSessionManager.Session getSession(String idInCluster)
AbstractSessionManager 中的 getSessionidInCluster - The session ID in the cluster, stripped of any worker name.
AbstractSessionManager.getSession(java.lang.String)public int getSessions()
AbstractSessionManager 中的 getSessionsAbstractSessionManager.getSessions()
public void doStart()
throws Exception
AbstractSessionManager 中的 doStartExceptionAbstractSessionManager.doStart()
public void doStop()
throws Exception
AbstractSessionManager 中的 doStopExceptionAbstractSessionManager.doStop()protected void invalidateSessions()
AbstractSessionManager 中的 invalidateSessionsprotected void invalidateSession(String idInCluster)
idInCluster - protected boolean removeSession(String idInCluster)
AbstractSessionManager 中的 removeSessionAbstractSessionManager.removeSession(java.lang.String)protected void addSession(AbstractSession session)
AbstractSessionManager 中的 addSessionAbstractSessionManager.addSession(org.eclipse.jetty.server.session.AbstractSession)protected AbstractSession newSession(HttpServletRequest request)
AbstractSessionManager 中的 newSessionAbstractSessionManager.newSession(javax.servlet.http.HttpServletRequest)
public void removeSession(AbstractSession session,
boolean invalidate)
AbstractSessionManager 中的 removeSessionsession - The session to removeinvalidate - True if HttpSessionListener.sessionDestroyed(HttpSessionEvent) and
SessionIdManager.invalidateAll(String) should be called.protected void expire(List<?> sessionIds)
sessionIds -
protected JDBCSessionManager.Session loadSession(String id,
String canonicalContextPath,
String vhost)
throws Exception
id -
Exception
protected void storeSession(JDBCSessionManager.Session session)
throws Exception
data -
Exception
protected void updateSession(JDBCSessionManager.Session data)
throws Exception
data - the session
Exception
protected void updateSessionNode(JDBCSessionManager.Session data)
throws Exception
data - the session
Exception
protected void deleteSession(JDBCSessionManager.Session data)
throws Exception
data -
Exception
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||