|
||||||||||
| 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.
There are synchronization constraints on this class. See the field
comments of the type: GuardedBy("lock").
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.
| Method Summary | |
|---|---|
void |
addScript(ScriptBuffer script)
Add a script to the list waiting for remote execution. |
void |
addScriptConduit(ScriptConduit conduit)
While a Marshaller is processing a request it can register a ScriptConduit with the ScriptSession to say - "pass scripts to me" |
boolean |
addScriptImmediately(ScriptBuffer script)
If this ScriptSession currently has a connected ScriptConduit
and this conduit accepts and claims to be able to publish the script
then publish and return true, otherwise return false. |
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the object bound with the specified name in this session, 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 session. |
long |
getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. |
java.lang.String |
getId()
Returns a string containing the unique identifier assigned to this session. |
long |
getLastAccessedTime()
Returns the last time the client sent a request associated with this session, 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. |
java.lang.String |
getWindowName()
Accessor for the name attached to this window |
int |
hashCode()
|
boolean |
hasWaitingScripts()
Allows for checking to see if there is data waiting to be returned |
void |
invalidate()
Invalidates this session 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 session. |
void |
removeScriptConduit(ScriptConduit conduit)
Remove a ScriptConduit. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Binds an object to this session, using the name specified. |
void |
setWindowName(java.lang.String windowName)
If the global parameter avoid2ConnectionLimitWithWindowName == true then we need to keep a track of the names of the windows that connect to us |
java.lang.String |
toString()
|
void |
updateLastAccessedTime()
Called whenever a browser accesses this ScriptSession to ensure that the session does not timeout before it should. |
void |
writeScripts(ScriptConduit conduit)
We might need to send a script directly to a conduit without adding the conduit to the "open" list and then removing it directly. |
| 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
HttpSessionBindingListener, the container calls
HttpSessionBindingListener.valueBound. The container then
notifies any HttpSessionAttributeListeners in the web
application.
If an object was already bound to this session of this name that
implements HttpSessionBindingListener, its
HttpSessionBindingListener.valueUnbound method is called.
If the value passed in is null, this has the same effect as calling
removeAttribute().
setAttribute in interface ScriptSession
name - the name to which the object is bound; cannot be nullvalue - the object to be bound
public void removeAttribute(java.lang.String name)
ScriptSessionAfter this method executes, and if the object implements
HttpSessionBindingListener, the container calls
HttpSessionBindingListener.valueUnbound. The container
then notifies any HttpSessionAttributeListeners in the web
application.
removeAttribute in interface ScriptSessionname - the name of the object to remove from this sessionpublic java.util.Iterator<java.lang.String> getAttributeNames()
ScriptSessionEnumeration of String objects
containing the names of all the objects bound to this session.
getAttributeNames in interface ScriptSessionIterator of Strings, specifying the
names of all the objects bound to this sessionpublic 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 execute
public void addScriptConduit(ScriptConduit conduit)
throws java.io.IOException
RealScriptSessionSeveral Marshallers may be active on the same page as a time and it doesn't really matter which gets the script. So ScriptSession should record all of the active ScriptConduits, but just pick one
addScriptConduit in interface RealScriptSessionconduit - The new ScriptConduit
java.io.IOException - If the write to the output failsRealScriptSession.removeScriptConduit(ScriptConduit)
public void writeScripts(ScriptConduit conduit)
throws java.io.IOException
RealScriptSession
writeScripts in interface RealScriptSessionconduit - The conduit to write to
java.io.IOException - If writing failspublic void removeScriptConduit(ScriptConduit conduit)
RealScriptSession
removeScriptConduit in interface RealScriptSessionconduit - The ScriptConduit to removeRealScriptSession.addScriptConduit(ScriptConduit)public boolean hasWaitingScripts()
RealScriptSession
hasWaitingScripts in interface RealScriptSessionpublic java.lang.String getPage()
ScriptSessionPageNormalizer, which
by default removes them.
getPage in interface ScriptSessionpublic void setWindowName(java.lang.String windowName)
RealScriptSession
setWindowName in interface RealScriptSessionwindowName - The new name for the window that spawned this Sessionpublic java.lang.String getWindowName()
RealScriptSession
getWindowName in interface RealScriptSessionpublic void updateLastAccessedTime()
RealScriptSession
updateLastAccessedTime in interface RealScriptSessionpublic 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.Objectpublic boolean addScriptImmediately(ScriptBuffer script)
RealScriptSessionScriptConduit
and this conduit accepts and claims to be able to publish the script
then publish and return true, otherwise return false.
Add a script to the list waiting for remote execution.
The version automatically wraps the string in a ClientScript object.
addScriptImmediately in interface RealScriptSessionscript - The script to execute
|
Copyright ¬ 2005 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||