|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.state.AppSession
public class AppSession
Generic session implementation. The session is specific for the application, and the session type can be overridden by letting DomApplication return a new instance that extends this class.
The AppSession also handles user request locking. To prevent us from having to synchronize the entire DOM and PAGE contexts all over the place we lock access to all session-related data as soon as a request touches the session. All requests to get the session pass thru RequestContext.getSession(). So this indicates that per-session data is needed. Before returning the session we check if another call is currently using the session; if so we block until that call leaves the session. When the session is free the current request will claim it using a lock in the session object. When a request terminates it is the responsibility of the toplevel request handler to always unlock the request.
Constructor Summary | |
---|---|
AppSession(DomApplication da)
|
Method Summary | |
---|---|
WindowSession |
createWindowSession()
Create a new WindowSession. |
void |
destroy()
Override to get control when this user's session is destroyed. |
void |
dump()
Helper utility to dump the session's conversational state. |
WindowSession |
findWindowSession(java.lang.String wid)
Try to locate the WindowSession with the specified ID in this HttpSession. |
DomApplication |
getApplication()
Questionable use. |
java.lang.Object |
getAttribute(java.lang.String name)
|
void |
internalCheckExpiredWindowSessions()
Walks all WindowSessions and checks to see if they have not been used for more than the window session timeout. |
void |
internalDestroy()
|
void |
internalLockSession()
INTERNAL USE ONLY. |
void |
internalObituaryReceived(java.lang.String cid,
int obitPageTag)
Mark the WindowSession as "possibly deleted". |
void |
internalUnlockSession()
INTERNAL USE ONLY. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent arg0)
Unused, needed for interface. |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0)
Called for non-debug sessions, where this is directly bound to a HttpSession. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AppSession(DomApplication da)
Method Detail |
---|
public final void internalDestroy()
public DomApplication getApplication()
public void destroy()
public final void valueBound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
HttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)
public final void valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
HttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)
public void internalLockSession()
public void internalUnlockSession()
public final void internalCheckExpiredWindowSessions()
public final WindowSession createWindowSession()
public final WindowSession findWindowSession(java.lang.String wid)
wid
-
public void internalObituaryReceived(java.lang.String cid, int obitPageTag) throws java.lang.Exception
To bloody ^**^&)*&^)&*%&^% complicate matters further the reception of the Obituary is often out-of-order, meaning that the request for the NEW page is received BEFORE the Obituary of the old page is received. This of course f*cks up the process, again. To fix this we keep track of when the last request was received, keeping in mind that the request and the obituary are always close together in time. For now we do not mark a WindowSession as possibly deleted if it's previous request is before but close to the obituary's request.
cm
- The WindowSession for which the obituary was received.obitPageTag
- The page tag of the page that has died.
java.lang.Exception
public void dump()
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface IAttributeContainer
IAttributeContainer.getAttribute(java.lang.String)
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface IAttributeContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |