|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.creamtec.ajaxswing.servlet.SessionManager
public class SessionManager
AjaxSwing does its own session management because certain servlet engines had problems with session expiration. The session manager runs a background thread that periodically checks if the sessions have been accessed. If a session has not been accessed for more then a timeout, is expired.
| Nested Class Summary | |
|---|---|
static class |
SessionManager.SessionInfo
Stores information about the managed session |
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
SessionManager(long sessionTimeout)
Initializes and starts the session manager |
|
SessionManager(long sessionTimeout,
java.lang.String name)
Initializes and starts the session manager |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.lang.Object session)
Resets timeout information for the given session. |
void |
addSession(java.lang.Object session,
SessionListener listener,
ClientAgentRemote agent)
Places a session into a map of sessions. |
SessionManager.SessionInfo |
getSession(int clientId)
|
java.util.Set |
getSessions()
Returns a set of all active sessions. |
long |
getSessionTimeout()
Returns session timeout |
void |
removeSession(java.lang.Object session)
Removes a given session from the managed list |
void |
run()
Periodically iterate all sessions and expire those that timed out |
void |
setSessionTimeout(long timeout)
Sets session timeout |
void |
shutdown()
Stops background session tracking thread. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SessionManager(long sessionTimeout)
sessionTimeout - timeout in seconds
public SessionManager(long sessionTimeout,
java.lang.String name)
sessionTimeout - timeout in secondsname - application name used for logging| Method Detail |
|---|
public void addSession(java.lang.Object session,
SessionListener listener,
ClientAgentRemote agent)
session - sessionlistener - will be called when this session has expiredpublic void removeSession(java.lang.Object session)
session - Objectpublic void actionPerformed(java.lang.Object session)
session - sessionpublic void shutdown()
public java.util.Set getSessions()
public long getSessionTimeout()
public void setSessionTimeout(long timeout)
timeout - new timeoutpublic void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic SessionManager.SessionInfo getSession(int clientId)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||