|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.appserver.server.sessionEnhydra.BasicSessionHome
public class BasicSessionHome
BasicSessionHome creates instances of BasicSession and manages the 'active'/'passive' state of those sessions. All sessions created by BasicSessionHome are held in memory.
The following parameters can be used to configure
the BasicSessionHome. They should be grouped together in a section,
normally SessionManager.SessionHome
, which is specified to
the constructor.
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.
BasicSession
,
StandardSession
,
StandardSessionManager
Constructor Summary | |
---|---|
BasicSessionHome(StandardSessionManager sessionMgr,
com.lutris.util.Config config)
|
|
BasicSessionHome(StandardSessionManager sessionMgr,
com.lutris.util.Config config,
java.lang.ClassLoader loader)
|
Method Summary | |
---|---|
boolean |
containsKey(java.lang.String sessionKey)
Specifies if a key is currently bound to a session. |
com.lutris.appserver.server.sessionEnhydra.StandardSession |
createSession(java.lang.String sessionKey)
Creates and returns a new session instance. |
protected void |
debug(int level,
java.lang.String msg)
Prints debug information under Logger.DEBUG. |
com.lutris.appserver.server.sessionEnhydra.StandardSession |
getSession(java.lang.String sessionKey)
Returns the session bound to the session key. |
com.lutris.appserver.server.sessionEnhydra.StandardSession |
getSession(java.lang.Thread thread,
java.lang.String sessionKey)
Returns the session bound to the specified session key. |
java.util.Enumeration |
keys()
Returns an enumeration of the keys for all the sessions. |
int |
pagedSize()
Returns the current number of sessions that are paged to persistent store. |
void |
passivateSession(java.lang.Thread thread,
java.lang.String sessionKey)
Puts a session into the 'passive' state. |
void |
removeSession(java.lang.String sessionKey)
Removes a session from the cache. |
void |
shutdown()
Shuts dows the session home. |
int |
size()
Returns the current number of sessions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicSessionHome(StandardSessionManager sessionMgr, com.lutris.util.Config config) throws 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 constaining the standard session home configuration.
com.lutris.util.ConfigException
- signifies a problem in the configuration file.public BasicSessionHome(StandardSessionManager sessionMgr, com.lutris.util.Config config, java.lang.ClassLoader loader) throws 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 constaining 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.Method Detail |
---|
public com.lutris.appserver.server.sessionEnhydra.StandardSession createSession(java.lang.String sessionKey) throws com.lutris.appserver.server.sessionEnhydra.CreateSessionException, com.lutris.appserver.server.sessionEnhydra.DuplicateKeyException, com.lutris.appserver.server.session.SessionException
createSession
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
sessionKey
- the key to associate with the session.
CreateSessionException
- if the session cannot be
created.
DuplicateKeyException
- if the session cannot
be created because the key is already in use.
com.lutris.appserver.server.session.SessionException
- if an error occurs.passivateSession(java.lang.Thread, java.lang.String)
public com.lutris.appserver.server.sessionEnhydra.StandardSession getSession(java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
getSession
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
sessionKey
- the session key for the session. If the session
doesn't exist or is not is not bound to the current
thread then null is returned.
com.lutris.appserver.server.session.SessionException
- if the session cannot be retrieved.getSession(Thread, String)
public com.lutris.appserver.server.sessionEnhydra.StandardSession getSession(java.lang.Thread thread, java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
getSession
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
thread
- the thread that should be associated with
the session while it is in the active state. Only this
thread can put the session back into the passive state.sessionKey
- the session key for the session that will be made
'active' and returned. If the session doesn't exist
then null is returned.
com.lutris.appserver.server.session.SessionException
- if the session cannot be retrieved.passivateSession(java.lang.Thread, java.lang.String)
public void removeSession(java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
removeSession
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
sessionKey
- the session key associated with the session.
com.lutris.appserver.server.session.SessionException
- if the session cannot be retrieved.public void passivateSession(java.lang.Thread thread, java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
passivateSession
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
thread
- the thread that is currently associated
with the session.sessionKey
- the session key for the session that will be made passive.
com.lutris.appserver.server.session.SessionException
- if the session cannot be retrieved.public boolean containsKey(java.lang.String sessionKey) throws com.lutris.appserver.server.session.SessionException
containsKey
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
sessionKey
- the session key to be tested.
com.lutris.appserver.server.session.SessionException
- if the existence of the key cannot be determined.public int size() throws com.lutris.appserver.server.session.SessionException
size
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
com.lutris.appserver.server.session.SessionException
- if the size cannot be determinedpublic int pagedSize() throws com.lutris.appserver.server.session.SessionException
pagedSize
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
com.lutris.appserver.server.session.SessionException
- if the size cannot be determinedpublic java.util.Enumeration keys() throws com.lutris.appserver.server.session.SessionException
keys
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
com.lutris.appserver.server.session.SessionException
- if the session enumeration cannot be retrieved.public void shutdown()
shutdown
in interface com.lutris.appserver.server.sessionEnhydra.StandardSessionHome
protected void debug(int level, java.lang.String msg)
level
- the debug level.msg
- the message to print.
|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |