| |
|
| java.lang.Object org.directwebremoting.impl.DefaultScriptSessionManager
DefaultScriptSessionManager | public class DefaultScriptSessionManager implements ScriptSessionManager(Code) | | A default implementation of ScriptSessionManager.
There are synchronization constraints on this class that could be broken
by subclasses. Specifically anyone accessing either sessionMap
or pageSessionMap must be holding the sessionLock .
In addition you should note that
DefaultScriptSession and
DefaultScriptSessionManager make calls to each other and you should
take care not to break any constraints in inheriting from these classes.
author: Joe Walker [joe at getahead dot ltd dot uk] |
ATTRIBUTE_HTTPSESSIONID | final public static String ATTRIBUTE_HTTPSESSIONID(Code) | | Use of this attribute is currently discouraged, we may make this public
in a later release. Until then, it may change or be removed without warning.
|
ATTRIBUTE_PAGE | final public static String ATTRIBUTE_PAGE(Code) | | Use of this attribute is currently discouraged, we may make this public
in a later release. Until then, it may change or be removed without warning.
|
DEFAULT_SESSION_CHECK_TIME | final protected static long DEFAULT_SESSION_CHECK_TIME(Code) | | By default we check for sessions that need expiring every 30 seconds
|
pageNormalizer | protected PageNormalizer pageNormalizer(Code) | | How we turn pages into the canonical form.
|
scriptSessionCheckTime | protected long scriptSessionCheckTime(Code) | | How often do we check for script sessions that need timing out
|
sessionLock | final protected Object sessionLock(Code) | | What we synchronize against when we want to access either sessionMap or
pageSessionMap
|
DefaultScriptSessionManager | public DefaultScriptSessionManager()(Code) | | Setup a timer that will invalidate sessions
|
associateScriptSessionAndHttpSession | protected void associateScriptSessionAndHttpSession(RealScriptSession scriptSession, String httpSessionId)(Code) | | Link a script session and an http session in some way
Exactly what we should do here is still something of a mystery. We don't
really have much experience on the best way to handle this, so currently
we're just setting a script session attribute that points at the
http session id, and not exposing it.
This method is an ideal point to override and do something better.
Parameters: scriptSession - The script session to be linked to an http session Parameters: httpSessionId - The http session from the browser with the given scriptSession |
associateScriptSessionAndPage | protected void associateScriptSessionAndPage(RealScriptSession scriptSession, String page)(Code) | | Link a script session to a web page.
This allows people to call
ServerContext.getScriptSessionsByPage(String) This method is an ideal point to override and do something better.
Parameters: scriptSession - The script session to be linked to a page Parameters: page - The page (un-normalized) to be linked to |
checkTimeouts | protected void checkTimeouts()(Code) | | Do a check on all the known sessions to see if and have timeout and need
removing.
|
fireScriptSessionCreatedEvent | protected void fireScriptSessionCreatedEvent(ScriptSession scriptSession)(Code) | | This should be called whenever a
ScriptSession is created
Parameters: scriptSession - The newly created ScriptSession |
fireScriptSessionDestroyedEvent | protected void fireScriptSessionDestroyedEvent(ScriptSession scriptSession)(Code) | | This should be called whenever a
ScriptSession is destroyed
Parameters: scriptSession - The newly destroyed ScriptSession |
getScriptSessionTimeout | public long getScriptSessionTimeout()(Code) | | |
getScriptSessionsByHttpSessionId | public Collection<RealScriptSession> getScriptSessionsByHttpSessionId(String httpSessionId)(Code) | | Lookup all the windows associated with a given browser
Parameters: httpSessionId - The browser id to lookup A list of script sessions for each open window |
invalidate | protected void invalidate(RealScriptSession scriptSession)(Code) | | Remove the given session from the list of sessions that we manage, and
leave it for the GC vultures to pluck.
Parameters: scriptSession - The session to get rid of |
maybeCheckTimeouts | protected void maybeCheckTimeouts()(Code) | | If we call
DefaultScriptSessionManager.checkTimeouts() too often is could bog things down so
we only check every one in a while (default 30 secs); this checks to see
of we need to check, and checks if we do.
|
setPageNormalizer | public void setPageNormalizer(PageNormalizer pageNormalizer)(Code) | | Accessor for the PageNormalizer.
Parameters: pageNormalizer - The new PageNormalizer |
setScriptSessionCheckTime | public void setScriptSessionCheckTime(long scriptSessionCheckTime)(Code) | | Parameters: scriptSessionCheckTime - the scriptSessionCheckTime to set |
setScriptSessionTimeout | public void setScriptSessionTimeout(long scriptSessionTimeout)(Code) | | |
|
|
|