|
|||||||||
| Home >> All >> com >> lutris >> appserver >> server >> [ session overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.lutris.appserver.server.session
Class DiskPagedSessionHome

java.lang.Objectcom.lutris.appserver.server.session.PagedSessionHome
com.lutris.appserver.server.session.DiskPagedSessionHome
- All Implemented Interfaces:
- StandardSessionHome
- public class DiskPagedSessionHome
- extends PagedSessionHome
The StandardSessionManager uses PagedSessionHome to manage a collection of sessions that can be paged to disk.
PagedSessionHome will page sessions to disk as soon as a pre-configured threshold of sessions has been reached. Only sessions in the 'passive' state will be paged to disk. If all sessions are in the 'active' state and the threshold has been reached, then a request to create a new session will block until one of the 'active' sessions goes into the 'passive' state. At this point the session that just became 'passive' is paged to disk and a new session is created.
Sessions are paged to disk by serializing the all 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.
The following parameters can be used to configure
the PagedSessionHome. They should be grouped together in a section,
normally SessionManager.SessionHome, which is specified to
the constructor.
PageThreshold: {int}Sessions are paged if the total number of sessions exceeds PageThreshold. If not set, defaults to 100.
PageWait: {int}Specifies the maximum time (in milliseconds) that a thread will wait for a session to be created or retrieved. If the page threshold has been reached, then a thread has to wait for an existing session to be paged before a new session can be created or a pre-existing session (that has been paged to disk) can be activated. If not set, defaults to 1 minute. If this time is exceeded then an exception is thrown - this prevents a possible deadlock situation.
PageDir: {String}The directory where sessions will be paged. This setting is required.
MaxSessions: {int}Specifies the maximum number of in use concurrent sessions. If this value is exceeded then CreateSession() will throw a CreateSessionException. -1 indicates unlimited session. If MaxSessions is not set in the application's configuration then MaxSessions defaults to unlimited sessions.
- Version:
- $Revision: 1.2.14.1 $
| Field Summary | |
private java.lang.String |
PAGE_DIR_KEY
Configuration keys. |
private java.util.Hashtable |
pagedCache
The paged cache contains handles to passive sessions that have been paged to disk. |
private com.lutris.util.PersistentStore |
store
The persistent storage interface. |
| Fields inherited from class com.lutris.appserver.server.session.PagedSessionHome |
loader, sessionMgr |
| Constructor Summary | |
DiskPagedSessionHome(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 |
deleteSession(java.lang.String sessionKey)
Deletes a paged session. |
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.session.PagedSessionHome |
checkPassiveSessions, containsKey, createSession, debug, debug, 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 |
| Field Detail |
pagedCache
private java.util.Hashtable pagedCache
- The paged cache contains handles to passive
sessions that have been paged to disk.
store
private com.lutris.util.PersistentStore store
- The persistent storage interface.
PAGE_DIR_KEY
private final java.lang.String PAGE_DIR_KEY
- Configuration keys.
- See Also:
- Constant Field Values
| Constructor Detail |
DiskPagedSessionHome
public DiskPagedSessionHome(StandardSessionManager sessionMgr, com.lutris.util.Config config, java.lang.ClassLoader loader) throws SessionException, com.lutris.util.ConfigException
| Method Detail |
newSession
protected PagedSession newSession(StandardSessionManager mgr, java.lang.String sessionKey) throws SessionException
- Creates a new session object. This method is intended to be
overriden by classes that extend PagedSessionHome.
- Specified by:
newSessionin classPagedSessionHome
deleteSession
protected void deleteSession(java.lang.String sessionKey) throws SessionException
- Deletes a paged session. If the session doesn't exist then this
is a noop.
- Specified by:
deleteSessionin classPagedSessionHome
pageOut
protected void pageOut(PagedSession s) throws SessionException
- Pages a session to disk.
- Specified by:
pageOutin classPagedSessionHome
pageIn
protected PagedSession pageIn(java.lang.String sessionKey) throws SessionException
- Reads a paged session from disk.
- Specified by:
pageInin classPagedSessionHome
getPagedSessionCount
protected int getPagedSessionCount()
throws SessionException
- Returns the number of paged sessions.
- Specified by:
getPagedSessionCountin classPagedSessionHome
pagedSessionKeyExists
protected boolean pagedSessionKeyExists(java.lang.String sessionKey) throws SessionException
- Returns true if the specified session key is in use
by a session that has been paged out.
- Specified by:
pagedSessionKeyExistsin classPagedSessionHome
getPagedSessionKeys
protected java.util.Enumeration getPagedSessionKeys() throws SessionException
- Returns an enumeration of the keys of all the sessions that have
been paged out to persistent storage.
- Specified by:
getPagedSessionKeysin classPagedSessionHome
cleanupNewPagedSession
protected boolean cleanupNewPagedSession()
throws SessionException
- Removes a session that is new and paged.
- Specified by:
cleanupNewPagedSessionin classPagedSessionHome
shutdown
public void shutdown()
- Shuts dows the session home. Removes paged sessions
from disk.
- Specified by:
shutdownin interfaceStandardSessionHome- Overrides:
shutdownin classPagedSessionHome
|
|||||||||
| Home >> All >> com >> lutris >> appserver >> server >> [ session overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC