|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.impl.DefaultScriptSession
public class DefaultScriptSession
An implementation of ScriptSession and RealScriptSession.
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.directwebremoting.extend.RealScriptSession |
|---|
RealScriptSession.Script |
| Method Summary | |
|---|---|
void |
addRunnable(java.lang.Runnable runnable)
Add a Runnable to the waiting list for execution. |
void |
addScript(ScriptBuffer script)
Add a script to the list waiting for remote execution. |
void |
clearSleeper(Sleeper sleeper)
Remove Sleeper. |
void |
confirmScripts(long confirmedScriptIndex)
Confirms that the client has received all scripts up to and including the supplied index so that script data may be purged. |
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this ScriptSession, or null if no object is bound under the name. |
java.util.Iterator<java.lang.String> |
getAttributeNames()
Returns an Enumeration of String objects
containing the names of all the objects bound to this ScriptSession. |
long |
getCreationTime()
Returns the time when this ScriptSession was created, measured in milliseconds since midnight January 1, 1970 GMT. |
java.lang.String |
getHttpSessionId()
If this ScriptSession's browser session also has a HttpSession then this method gives access to its id (typically corresponding to the JSESSIONID cookie). |
java.lang.String |
getId()
Returns a string containing the unique identifier assigned to this ScriptSession. |
long |
getLastAccessedTime()
Returns the last time the client sent a request associated with this ScriptSession, as the number of milliseconds since 1/1/1970 GMT, and marked by the time the container received the request. |
java.lang.String |
getPage()
What page is this script session attached to? The page does not include server information, but does include everything from the host/port onwards, including the query parameters depending on the configured PageNormalizer, which by default removes them. |
RealScriptSession.Script |
getScript(long scriptIndex)
Get queued script from the supplied index. |
int |
hashCode()
|
void |
invalidate()
Invalidates this ScriptSession then unbinds any objects bound to it. |
boolean |
isInvalidated()
Checks to see if this ScriptSession has been invalidated. |
void |
removeAttribute(java.lang.String name)
Removes the object bound with the specified name from this ScriptSession. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this ScriptSession, using the name specified. |
void |
setConnectionValidationTimeout(int connectionValidationTimeout)
Set the time to wait for client to poll when asking for connection validation. |
void |
setHttpSessionId(java.lang.String httpSessionId)
Set a new HttpSession id for the ScriptSession |
void |
setPage(java.lang.String page)
Set a new page for the ScriptSession (in case of HTML pushState) |
void |
setSleeper(Sleeper sleeper)
While a Marshaller is processing a request it can register a Sleeper with the ScriptSession to say - "tell me when there is new data" |
java.lang.String |
toString()
|
void |
updateLastAccessedTime()
Called whenever a browser accesses this ScriptSession to ensure that the session does not timeout before it should. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.lang.Object getAttribute(java.lang.String name)
ScriptSessionnull if no object is bound under the name.
getAttribute in interface ScriptSessionname - a string specifying the name of the object
public void setAttribute(java.lang.String name,
java.lang.Object value)
ScriptSessionAfter this method executes, and if the new object implements
ScriptSessionBindingListener, the container calls
ScriptSessionBindingListener.valueBound(org.directwebremoting.event.ScriptSessionBindingEvent).
If an object was already bound to this ScriptSession of this name that
implements ScriptSessionBindingListener, its
ScriptSessionBindingListener.valueUnbound(org.directwebremoting.event.ScriptSessionBindingEvent) method is called.
If the value passed in is null, this has the same effect as calling
ScriptSession.removeAttribute(java.lang.String).
setAttribute in interface ScriptSessionname - the name to which the object is bound; cannot be nullvalue - the object to be boundpublic void removeAttribute(java.lang.String name)
ScriptSessionAfter this method executes, and if the object implements
ScriptSessionBindingListener, the container calls
ScriptSessionBindingListener.valueUnbound(org.directwebremoting.event.ScriptSessionBindingEvent).
removeAttribute in interface ScriptSessionname - the name of the object to remove from this ScriptSessionpublic java.util.Iterator<java.lang.String> getAttributeNames()
ScriptSessionEnumeration of String objects
containing the names of all the objects bound to this ScriptSession.
getAttributeNames in interface ScriptSessionIterator of Strings, specifying the
names of all the objects bound to this ScriptSessionpublic void invalidate()
ScriptSession
invalidate in interface ScriptSessionpublic boolean isInvalidated()
ScriptSessionThere is no similar method on HttpSession
because it is assumed that you do not store HttpSessions from one request
to another, so all sessions that you have access to will always be either
valid, or you have just invalidated it yourself so you wont need to ask.
This method makes up for the change that now ScriptSessions are
accessible from outside the normal scope.
isInvalidated in interface ScriptSessionpublic java.lang.String getId()
ScriptSession
getId in interface ScriptSessionpublic long getCreationTime()
ScriptSession
getCreationTime in interface ScriptSessionpublic long getLastAccessedTime()
ScriptSessionActions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.
getLastAccessedTime in interface ScriptSessionpublic void addScript(ScriptBuffer script)
ScriptSession
addScript in interface ScriptSessionscript - The script to executepublic void addRunnable(java.lang.Runnable runnable)
ScriptSession
addRunnable in interface ScriptSessionpublic void setSleeper(Sleeper sleeper)
RealScriptSession
setSleeper in interface RealScriptSessionpublic void clearSleeper(Sleeper sleeper)
RealScriptSession
clearSleeper in interface RealScriptSessionpublic RealScriptSession.Script getScript(long scriptIndex)
RealScriptSession
getScript in interface RealScriptSessionscriptIndex - index
public void confirmScripts(long confirmedScriptIndex)
RealScriptSession
confirmScripts in interface RealScriptSessionconfirmedScriptIndex - last index that can be purgedpublic void setPage(java.lang.String page)
RealScriptSession
setPage in interface RealScriptSessionpublic java.lang.String getPage()
ScriptSession
getPage in interface ScriptSessionpublic void setHttpSessionId(java.lang.String httpSessionId)
RealScriptSession
setHttpSessionId in interface RealScriptSessionpublic java.lang.String getHttpSessionId()
ScriptSession
getHttpSessionId in interface ScriptSessionpublic void updateLastAccessedTime()
RealScriptSession
updateLastAccessedTime in interface RealScriptSessionpublic void setConnectionValidationTimeout(int connectionValidationTimeout)
connectionValidationTimeout - public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||