| |
|
| java.lang.Object com.lutris.appserver.server.sessionEnhydra.PagedSessionHome com.lutris.appserver.server.sessionEnhydra.DiskPagedSessionHome
DiskPagedSessionHome | public class DiskPagedSessionHome extends PagedSessionHome (Code) | | 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.
SaveOnRestart: (true|false}
Indicate that shold we saves all (active and passive) sessions on disk
when restart application.
If we use SessionManager.MemoryPersistence = true then ignore
SaveOnRestart parameter.
See Also: StandardSession See Also: StandardSessionManager version: $Revision: 1.3 $ author: Kyle Clark |
DiskPagedSessionHome | public DiskPagedSessionHome(StandardSessionManager sessionMgr, Config config, ClassLoader loader) throws SessionException, ConfigException(Code) | | Parameters: sessionMgr - The session manager associated with this session home. Parameters: config - Object parsed from configuration file. This should befor the section containing the standard session home configuration. Parameters: loader - The class load to use when load objects from persistent store. exception: ConfigException - signifies a problem in the configuration file. exception: SessionException - if the initialization fails. |
deleteSession | protected void deleteSession(String sessionKey) throws SessionException(Code) | | Deletes a paged session. If the session doesn't exist then this
is a noop.
Parameters: sessionKey - the key identifying the sessionthat should be deleted. |
getPagedSessionCount | protected synchronized int getPagedSessionCount() throws SessionException(Code) | | Returns the number of paged sessions.
exception: SessionException - if the paged session countcannot be retrieved. |
getPagedSessionKeys | protected Enumeration getPagedSessionKeys() throws SessionException(Code) | | Returns an enumeration of the keys of all the sessions that have
been paged out to persistent storage.
the session key enumeration. exception: SessionException - if an error occurs. |
pageIn | protected synchronized PagedSession pageIn(String sessionKey) throws SessionException(Code) | | Reads a paged session from disk.
Parameters: sessionKey - the key identifying the session that shouldbe paged in. the paged session that was read in. exception: SessionException - if the paged session could not beread in or does not exist. |
pagedSessionKeyExists | protected boolean pagedSessionKeyExists(String sessionKey) throws SessionException(Code) | | Returns true if the specified session key is in use
by a session that has been paged out.
Parameters: sessionKey - the session key to test. true if the session key is in use by a paged session. |
shutdown | public void shutdown()(Code) | | Shuts dows the session home. Removes paged sessions
from disk or page all sessions if key SaveOnRestart = true.
|
|
|
|