public class AppSession extends Object implements javax.servlet.http.HttpSessionBindingListener, IAttributeContainer
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 and Description |
|---|
AppSession(DomApplication da) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearExceptionRetryCount() |
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(String wid)
Try to locate the WindowSession with the specified ID in this HttpSession.
|
DomApplication |
getApplication()
Questionable use.
|
Object |
getAttribute(String name) |
int |
getExceptionRetryCount() |
List<UserLogItem> |
getLogItems()
Get a copy of the currently collected log entries.
|
int |
incrementExceptionCount() |
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(String cid,
int obitPageTag)
Mark the WindowSession as "possibly deleted".
|
void |
internalUnlockSession()
INTERNAL USE ONLY.
|
void |
log(UserLogItem uli)
Add a log item to the round-robin list of per user log entries.
|
void |
logUser(String cid,
String message) |
void |
setAttribute(String name,
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.
|
public AppSession(@Nonnull DomApplication da)
public final void internalDestroy()
@Nonnull public DomApplication getApplication()
public void destroy()
public final void valueBound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueBound in interface javax.servlet.http.HttpSessionBindingListenerHttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)public final void valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueUnbound in interface javax.servlet.http.HttpSessionBindingListenerHttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)public void internalLockSession()
public void internalUnlockSession()
public final void internalCheckExpiredWindowSessions()
@Nonnull public final WindowSession createWindowSession()
@Nullable public final WindowSession findWindowSession(@Nonnull String wid)
wid - public void internalObituaryReceived(String cid, int obitPageTag) throws 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.Exceptionpublic void dump()
@Nullable public Object getAttribute(@Nonnull String name)
getAttribute in interface IAttributeContainerIAttributeContainer.getAttribute(java.lang.String)public void setAttribute(@Nonnull String name, @Nullable Object value)
setAttribute in interface IAttributeContainerpublic int getExceptionRetryCount()
public int incrementExceptionCount()
public void clearExceptionRetryCount()
public void log(@Nonnull UserLogItem uli)
uli - @Nonnull public List<UserLogItem> getLogItems()
Copyright © 2017 etc.to. All rights reserved.