org.directwebremoting.extend
Class DefaultJavascriptFunction

java.lang.Object
  extended by org.directwebremoting.extend.DefaultJavascriptFunction
All Implemented Interfaces:
JavascriptFunction

public class DefaultJavascriptFunction
extends java.lang.Object
implements JavascriptFunction

Represents a callback function, passed in from a client for later execution.

A DefaultJavascriptFunction is tied to a specific function in a specific browser page. In this way the eval of a DefaultJavascriptFunction is outside of the normal execution scoping provided by Browser.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
DefaultJavascriptFunction(ScriptSession session, java.lang.String id)
           
 
Method Summary
 void close()
          A small amount of data is stored on the client to track the remotely.
 boolean equals(java.lang.Object obj)
           
 void execute(java.lang.Object... params)
          Execute the function.
 void executeAndClose(java.lang.Object... params)
          Execute the function, and clear it's data from the client.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultJavascriptFunction

public DefaultJavascriptFunction(ScriptSession session,
                                 java.lang.String id)
Method Detail

execute

public void execute(java.lang.Object... params)
Description copied from interface: JavascriptFunction
Execute the function. TODO: At some stage it would be good to allow the final parameter to be a Callback....

Specified by:
execute in interface JavascriptFunction
Parameters:
params - The data to pass to the server

close

public void close()
Description copied from interface: JavascriptFunction
A small amount of data is stored on the client to track the remotely. accessible objects. To clear this data, the function needs to be cleared on the server.

Specified by:
close in interface JavascriptFunction

executeAndClose

public void executeAndClose(java.lang.Object... params)
Description copied from interface: JavascriptFunction
Execute the function, and clear it's data from the client.

Specified by:
executeAndClose in interface JavascriptFunction
Parameters:
params - The data to pass to the server
See Also:
JavascriptFunction.execute(java.lang.Object...), JavascriptFunction.close()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Copyright 2008