|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.appserver.server.sessionEnhydra.PagedSessionHome
com.lutris.appserver.server.sessionEnhydra.persistent.PersistentSessionHome
public class PersistentSessionHome
PersistentSessionHome writes all passive sessions to a database. The sessions are written by serializing all the data (excluding the session manager) that is associated with a session. This requires that the session data and user associated with a session are serializable. PersistentSessionHome should be used by applications that want failover support or that want to run in a clustered environment.
The session data is written to a table in the database that is defined as (Informix):
CREATE TABLE PersistentSession ( sessionKey VARCHAR(64) NOT NULL, isNew CHAR(1) DEFAULT "1" NOT NULL, timeCreated DECIMAL(19,0), timeLastUsed DECIMAL(19,0), timeExpires DECIMAL(19,0), maxIdleTime DECIMAL(19,0), maxNoUserIdleTime INTEGER, userName VARCHAR(255), data BYTE, PRIMARY KEY(sessionKey) )The configuration settings for PersistentSessionHome:
DatabaseName: {String}
The database that will be accessed. This session is optional. If not set then the default database is accessed.
DBTableName: {String}
The name of the table in the database where session data will be written. The default table name is "PersistentSession".
StandardSessionManager
Field Summary |
---|
Fields inherited from class com.lutris.appserver.server.sessionEnhydra.PagedSessionHome |
---|
loader, sessionMgr |
Constructor Summary | |
---|---|
PersistentSessionHome(StandardSessionManager sessionMgr,
com.lutris.util.Config config,
java.lang.ClassLoader loader)
|
Method Summary | |
---|---|
protected boolean |
cleanupNewPagedSession()
Removes a session that is new and paged. |
protected void |
debug(int level,
java.lang.String msg)
Prints debug information under Logger.DEBUG. |
protected void |
debug(java.lang.String msg)
Prints debug information under Logger.DEBUG. |
protected void |
deleteSession(java.lang.String sessionKey)
Deletes a paged session. |
java.lang.String |
getDatabaseName()
Returns the name of the database being accessed by this manager. |
static java.lang.String |
getDatabaseName(com.lutris.util.Config config)
Returns the name of the database that should be accessed. |
protected int |
getPagedSessionCount()
Returns the number of paged sessions. |
protected java.util.Enumeration |
getPagedSessionKeys()
Returns an enumeration of the keys of all the sessions that have been paged out to persistent storage. |
protected PagedSession |
newSession(StandardSessionManager mgr,
java.lang.String sessionKey)
Creates a new session object. |
protected boolean |
pagedSessionKeyExists(java.lang.String sessionKey)
Returns true if the specified session key is in use by a session that has been paged out. |
protected PagedSession |
pageIn(java.lang.String sessionKey)
Reads a paged session from disk. |
protected void |
pageOut(PagedSession s)
Pages a session to disk. |
void |
shutdown()
Shuts dows the session home. |
Methods inherited from class com.lutris.appserver.server.sessionEnhydra.PagedSessionHome |
---|
containsKey, createSession, getSession, getSession, keys, pagedSize, passivateSession, removeSession, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PersistentSessionHome(StandardSessionManager sessionMgr, com.lutris.util.Config config, java.lang.ClassLoader loader) throws com.lutris.appserver.server.session.SessionException, com.lutris.util.ConfigException
sessionMgr
- The session manager associated with this session home.config
- Object parsed from configuration file. This should be
for the section containing the standard session home configuration.loader
- The class load to use when load objects from persistent store.
com.lutris.util.ConfigException
- signifies a problem in the configuration file.
com.lutris.appserver.server.session.SessionException
- if the initialization fails.Method Detail |
---|
public java.lang.String getDatabaseName()
public static java.lang.String getDatabaseName(com.lutris.util.Config config) throws com.lutris.util.ConfigException
config
- the config in whihc to look up the database
setting.
com.lutris.util.ConfigException
- if an error occurs.protected PagedSession newSession(StandardSessionManager mgr, java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
newSession
in class PagedSessionHome
com.lutris.appserver.server.session.SessionException
- if an error occurs.protected void deleteSession(java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
deleteSession
in class PagedSessionHome
sessionKey
- the key identifying the session
that should be deleted.
com.lutris.appserver.server.session.SessionException
protected void pageOut(PagedSession s) throws com.lutris.appserver.server.session.SessionException
pageOut
in class PagedSessionHome
session
- the session to page.
com.lutris.appserver.server.session.SessionException
- if the paged session could not be
paged out.protected PagedSession pageIn(java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
pageIn
in class PagedSessionHome
sessionKey
- the key identifying the session that should
be paged in.
com.lutris.appserver.server.session.SessionException
- if the paged session could not be
read in or does not exist.protected int getPagedSessionCount() throws com.lutris.appserver.server.session.SessionException
getPagedSessionCount
in class PagedSessionHome
com.lutris.appserver.server.session.SessionException
protected boolean pagedSessionKeyExists(java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
pagedSessionKeyExists
in class PagedSessionHome
sessionKey
- the session key to test.
com.lutris.appserver.server.session.SessionException
- if an error occurs.protected java.util.Enumeration getPagedSessionKeys() throws com.lutris.appserver.server.session.SessionException
getPagedSessionKeys
in class PagedSessionHome
com.lutris.appserver.server.session.SessionException
- if an error occurs.protected boolean cleanupNewPagedSession() throws com.lutris.appserver.server.session.SessionException
cleanupNewPagedSession
in class PagedSessionHome
com.lutris.appserver.server.session.SessionException
- if an error occurs.public void shutdown()
shutdown
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
shutdown
in class PagedSessionHome
protected void debug(java.lang.String msg)
debug
in class PagedSessionHome
msg
- the message to print.protected void debug(int level, java.lang.String msg)
debug
in class PagedSessionHome
level
- the debug level.msg
- the message to print.
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |