org.eclipse.jetty.server.session
类 JDBCSessionIdManager

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

public class JDBCSessionIdManager
extends AbstractSessionIdManager

JDBCSessionIdManager SessionIdManager implementation that uses a database to store in-use session ids, to support distributed sessions.


嵌套类摘要
 class JDBCSessionIdManager.DatabaseAdaptor
          DatabaseAdaptor Handles differences between databases.
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
protected  String _blobType
           
protected  String _connectionUrl
           
protected  String _createSessionIdTable
           
protected  String _createSessionTable
           
protected  DataSource _datasource
           
protected  JDBCSessionIdManager.DatabaseAdaptor _dbAdaptor
           
protected  String _deleteId
           
protected  String _deleteOldExpiredSessions
           
protected  String _deleteSession
           
protected  Driver _driver
           
protected  String _driverClassName
           
protected  String _insertId
           
protected  String _insertSession
           
protected  String _jndiName
           
protected  long _lastScavengeTime
           
protected  String _longType
           
protected  String _queryId
           
protected  long _scavengeIntervalMs
           
protected  String _selectBoundedExpiredSessions
           
protected  Server _server
           
protected  HashSet<String> _sessionIds
           
protected  String _sessionIdTable
           
protected  String _sessionTable
           
protected  String _sessionTableRowId
           
protected  TimerTask _task
           
protected  Timer _timer
           
protected  String _updateSession
           
protected  String _updateSessionAccessTime
           
protected  String _updateSessionNode
           
 
从类 org.eclipse.jetty.server.session.AbstractSessionIdManager 继承的字段
_random, _reseed, _weakRandom, _workerName
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
JDBCSessionIdManager(Server server)
           
JDBCSessionIdManager(Server server, Random random)
           
 
方法摘要
 void addSession(HttpSession session)
          Add a session to the list of known sessions for a given ID.
 void doStart()
          Start up the id manager.
 void doStop()
          Stop the scavenger.
 String getBlobType()
           
 String getClusterId(String nodeId)
          Get the session id without any node identifier suffix.
protected  Connection getConnection()
          Get a connection from the driver or datasource.
 String getConnectionUrl()
           
 DataSource getDataSource()
           
 String getDatasourceName()
           
 String getDriverClassName()
           
 String getLongType()
           
 String getNodeId(String clusterId, HttpServletRequest request)
          Get the session id, including this node's id as a suffix.
 long getScavengeInterval()
           
 boolean idInUse(String id)
           
 void invalidateAll(String id)
          Invalidate the session matching the id on all contexts.
 void removeSession(HttpSession session)
          Remove session from the list of known sessions for a given ID.
 void removeSession(String id)
           
 void setBlobType(String name)
           
 void setDatasource(DataSource ds)
           
 void setDatasourceName(String jndi)
           
 void setDriverInfo(Driver driverClass, String connectionUrl)
          Configure jdbc connection information via a jdbc Driver
 void setDriverInfo(String driverClassName, String connectionUrl)
          Configure jdbc connection information via a jdbc Driver
 void setLongType(String longType)
           
 void setScavengeInterval(long sec)
           
 
从类 org.eclipse.jetty.server.session.AbstractSessionIdManager 继承的方法
getRandom, getReseed, getWorkerName, initRandom, newSessionId, setRandom, setReseed, setWorkerName
 
从类 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
 

字段详细信息

_sessionIds

protected final HashSet<String> _sessionIds

_server

protected Server _server

_driver

protected Driver _driver

_driverClassName

protected String _driverClassName

_connectionUrl

protected String _connectionUrl

_datasource

protected DataSource _datasource

_jndiName

protected String _jndiName

_sessionIdTable

protected String _sessionIdTable

_sessionTable

protected String _sessionTable

_sessionTableRowId

protected String _sessionTableRowId

_timer

protected Timer _timer

_task

protected TimerTask _task

_lastScavengeTime

protected long _lastScavengeTime

_scavengeIntervalMs

protected long _scavengeIntervalMs

_blobType

protected String _blobType

_longType

protected String _longType

_createSessionIdTable

protected String _createSessionIdTable

_createSessionTable

protected String _createSessionTable

_selectBoundedExpiredSessions

protected String _selectBoundedExpiredSessions

_deleteOldExpiredSessions

protected String _deleteOldExpiredSessions

_insertId

protected String _insertId

_deleteId

protected String _deleteId

_queryId

protected String _queryId

_insertSession

protected String _insertSession

_deleteSession

protected String _deleteSession

_updateSession

protected String _updateSession

_updateSessionNode

protected String _updateSessionNode

_updateSessionAccessTime

protected String _updateSessionAccessTime

_dbAdaptor

protected JDBCSessionIdManager.DatabaseAdaptor _dbAdaptor
构造方法详细信息

JDBCSessionIdManager

public JDBCSessionIdManager(Server server)

JDBCSessionIdManager

public JDBCSessionIdManager(Server server,
                            Random random)
方法详细信息

setDriverInfo

public void setDriverInfo(String driverClassName,
                          String connectionUrl)
Configure jdbc connection information via a jdbc Driver

参数:
driverClassName -
connectionUrl -

setDriverInfo

public void setDriverInfo(Driver driverClass,
                          String connectionUrl)
Configure jdbc connection information via a jdbc Driver

参数:
driverClass -
connectionUrl -

setDatasource

public void setDatasource(DataSource ds)

getDataSource

public DataSource getDataSource()

getDriverClassName

public String getDriverClassName()

getConnectionUrl

public String getConnectionUrl()

setDatasourceName

public void setDatasourceName(String jndi)

getDatasourceName

public String getDatasourceName()

setBlobType

public void setBlobType(String name)

getBlobType

public String getBlobType()

getLongType

public String getLongType()

setLongType

public void setLongType(String longType)

setScavengeInterval

public void setScavengeInterval(long sec)

getScavengeInterval

public long getScavengeInterval()

addSession

public void addSession(HttpSession session)
从接口 SessionIdManager 复制的描述
Add a session to the list of known sessions for a given ID.

参数:
session - The session

removeSession

public void removeSession(HttpSession session)
从接口 SessionIdManager 复制的描述
Remove session from the list of known sessions for a given ID.


removeSession

public void removeSession(String id)

getClusterId

public String getClusterId(String nodeId)
Get the session id without any node identifier suffix.

返回:
the cluster id
另请参见:
SessionIdManager.getClusterId(java.lang.String)

getNodeId

public String getNodeId(String clusterId,
                        HttpServletRequest request)
Get the session id, including this node's id as a suffix.

参数:
clusterId - The ID of the session
request - The request that for the session (or null)
返回:
The session ID qualified with the node ID.
另请参见:
SessionIdManager.getNodeId(java.lang.String, javax.servlet.http.HttpServletRequest)

idInUse

public boolean idInUse(String id)
参数:
id - The session ID without any cluster node extension
返回:
True if the session ID is in use by at least one context.

invalidateAll

public void invalidateAll(String id)
Invalidate the session matching the id on all contexts.

参数:
id - The session ID without any cluster node extension
另请参见:
SessionIdManager.invalidateAll(java.lang.String)

doStart

public void doStart()
             throws Exception
Start up the id manager. Makes necessary database tables and starts a Session scavenger thread.

覆盖:
AbstractSessionIdManager 中的 doStart
抛出:
Exception

doStop

public void doStop()
            throws Exception
Stop the scavenger.

覆盖:
AbstractSessionIdManager 中的 doStop
抛出:
Exception

getConnection

protected Connection getConnection()
                            throws SQLException
Get a connection from the driver or datasource.

返回:
the connection for the datasource
抛出:
SQLException


Copyright © 2013. All Rights Reserved.