public class JDBCSessionIdManager extends AbstractSessionIdManager
Modifier and Type | Class and Description |
---|---|
class |
JDBCSessionIdManager.DatabaseAdaptor
DatabaseAdaptor
Handles differences between databases.
|
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
_random, _weakRandom, _workerName
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
Constructor and Description |
---|
JDBCSessionIdManager(Server server) |
JDBCSessionIdManager(Server server,
Random random) |
Modifier and Type | Method and Description |
---|---|
void |
addSession(javax.servlet.http.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,
javax.servlet.http.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(javax.servlet.http.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) |
getRandom, getWorkerName, initRandom, newSessionId, setRandom, setWorkerName
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
protected Server _server
protected Driver _driver
protected String _driverClassName
protected String _connectionUrl
protected DataSource _datasource
protected String _jndiName
protected String _sessionIdTable
protected String _sessionTable
protected String _sessionTableRowId
protected Timer _timer
protected TimerTask _task
protected long _lastScavengeTime
protected long _scavengeIntervalMs
protected String _blobType
protected String _longType
protected String _createSessionIdTable
protected String _createSessionTable
protected String _selectBoundedExpiredSessions
protected String _deleteOldExpiredSessions
protected String _insertId
protected String _deleteId
protected String _queryId
protected String _insertSession
protected String _deleteSession
protected String _updateSession
protected String _updateSessionNode
protected String _updateSessionAccessTime
protected JDBCSessionIdManager.DatabaseAdaptor _dbAdaptor
public JDBCSessionIdManager(Server server)
public void setDriverInfo(String driverClassName, String connectionUrl)
driverClassName
- connectionUrl
- public void setDriverInfo(Driver driverClass, String connectionUrl)
driverClass
- connectionUrl
- public void setDatasource(DataSource ds)
public DataSource getDataSource()
public String getDriverClassName()
public String getConnectionUrl()
public void setDatasourceName(String jndi)
public String getDatasourceName()
public void setBlobType(String name)
public String getBlobType()
public String getLongType()
public void setLongType(String longType)
public void setScavengeInterval(long sec)
public long getScavengeInterval()
public void addSession(javax.servlet.http.HttpSession session)
SessionIdManager
session
- The sessionpublic void removeSession(javax.servlet.http.HttpSession session)
SessionIdManager
public void removeSession(String id)
public String getClusterId(String nodeId)
SessionIdManager.getClusterId(java.lang.String)
public String getNodeId(String clusterId, javax.servlet.http.HttpServletRequest request)
clusterId
- The ID of the sessionrequest
- The request that for the session (or null)SessionIdManager.getNodeId(java.lang.String, javax.servlet.http.HttpServletRequest)
public boolean idInUse(String id)
id
- The session ID without any cluster node extensionpublic void invalidateAll(String id)
id
- The session ID without any cluster node extensionSessionIdManager.invalidateAll(java.lang.String)
public void doStart()
doStart
in class AbstractSessionIdManager
public void doStop() throws Exception
doStop
in class AbstractSessionIdManager
Exception
protected Connection getConnection() throws SQLException
SQLException
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.