| java.lang.Object org.directwebremoting.proxy.ScriptProxy org.directwebremoting.proxy.openajax.OpenAjax
OpenAjax | public class OpenAjax extends ScriptProxy (Code) | | Util is a server-side proxy that allows Java programmers to call client
side Javascript from Java.
Each Util object is associated with a list of ScriptSessions and the
proxy code is creates will be dynamically forwarded to all those browsers.
Currently this class contains only the write-only DOM manipulation functions
from Util. It is possible that we could add the read methods, however
the complexity in the callback and the fact that you are probably not going
to need it means that we'll leave it for another day. Specifically,
getValue , getValues and getText have
been left out as being read functions and useLoadingMessage etc
have been left out as not being DOM related.
author: Joe Walker [joe at getahead dot ltd dot uk] author: Jorge Martin Cuervo [darthkorr at gmail dot com] |
Method Summary | |
public void | publish(String prefix, String name) Publishes (broadcasts) an event based on a library-specific prefix and
event name.
Parameters: prefix - The prefix that corresponds to this event. | public void | publish(String prefix, String name, Object publisherData) Publishes (broadcasts) an event based on a library-specific prefix and
event name.
Parameters: prefix - The prefix that corresponds to this event. | public void | subscribe(String prefix, String name, PublishListener listener) Allows registration of interest in named events based on library-specific
prefix and event name. | public void | subscribe(String prefix, String name, PublishListener listener, Object subscriberData) Allows registration of interest in named events based on library-specific
prefix and event name. | public void | unsubscribe(String prefix, String name, PublishListener listener) Removes a subscription to an event. |
OpenAjax | public OpenAjax(ScriptSession scriptSession)(Code) | | Http thread constructor that alters a single browser
Parameters: scriptSession - The browser to alter |
OpenAjax | public OpenAjax(Collection<ScriptSession> scriptSessions)(Code) | | Http thread constructor that alters a number of browsers
Parameters: scriptSessions - A collection of ScriptSessions that we should act on. |
publish | public void publish(String prefix, String name)(Code) | | Publishes (broadcasts) an event based on a library-specific prefix and
event name.
Parameters: prefix - The prefix that corresponds to this event. This must be aprefix that has been registered via OpenAjax.registerLibrary(). Parameters: name - The name of the event to listen for. Names can be any string |
publish | public void publish(String prefix, String name, Object publisherData)(Code) | | Publishes (broadcasts) an event based on a library-specific prefix and
event name.
Parameters: prefix - The prefix that corresponds to this event. This must be aprefix that has been registered via OpenAjax.registerLibrary(). Parameters: name - The name of the event to listen for. Names can be any string Parameters: publisherData - An arbitrary Object holding extra information thatwill be passed as an argument to the handler function. Can be null. |
subscribe | public void subscribe(String prefix, String name, PublishListener listener)(Code) | | Allows registration of interest in named events based on library-specific
prefix and event name. Global event matching is provided by passing "*"
in the prefix and/or name arguments. Optional arguments may be specified
for executing the specified handler function in a provided scope and for
further filtering events prior to application.
The callback function will receive the following parameters
(see OpenAjax.publish() for description of publisherData):
function(prefix, name, subscriberData, publisherData){ ... }
Parameters: prefix - The prefix that corresponds to this library. This is thesame value that was previously passed to registerLibrary(). Can be "*" tomatch the provided event name across all libraries. Parameters: name - The name of the event to listen for. Names can be any string.Can be "*" to match all events in the specified toolkit (see prefix). Ifboth name and prefix specify "*", all events in the system will be routedto the registered handler (modulo any filtering provided by filter). Parameters: listener - The object to deliver messages to |
subscribe | public void subscribe(String prefix, String name, PublishListener listener, Object subscriberData)(Code) | | Allows registration of interest in named events based on library-specific
prefix and event name. Global event matching is provided by passing "*"
in the prefix and/or name arguments. Optional arguments may be specified
for executing the specified handler function in a provided scope and for
further filtering events prior to application.
The callback function will receive the following parameters
(see OpenAjax.publish() for description of publisherData):
function(prefix, name, subscriberData, publisherData){ ... }
Parameters: prefix - The prefix that corresponds to this library. This is thesame value that was previously passed to registerLibrary(). Can be "*" tomatch the provided event name across all libraries. Parameters: name - The name of the event to listen for. Names can be any string.Can be "*" to match all events in the specified toolkit (see prefix). Ifboth name and prefix specify "*", all events in the system will be routedto the registered handler (modulo any filtering provided by filter). Parameters: listener - The object to deliver messages to |
unsubscribe | public void unsubscribe(String prefix, String name, PublishListener listener)(Code) | | Removes a subscription to an event. In order for a subscription to be
removed, the values of the parameters supplied to OpenAjax.unsubscribe()
must exactly match the values of the parameters supplied to a previous
call to OpenAjax.subscribe(). Note that it is possible that one
invocation of OpenAjax.unsubscribe() might result in removal of multiple
subscriptions.
Parameters: prefix - The prefix that corresponds to this library. This is thesame value that was previously passed to registerLibrary(). Can be "*" tomatch the provided event name across all libraries. Parameters: name - The name of the event to listen for. Names can be any string.Can be "*" to match all events in the specified toolkit (see prefix). Ifboth name and prefix specify "*", all events in the system will be routedto the registered handler (modulo any filtering provided by filter). Parameters: listener - The object to deliver messages to |
Methods inherited from org.directwebremoting.proxy.ScriptProxy | public void addFunctionCall(String funcName)(Code)(Java Doc) public void addFunctionCall(String funcName, Object param1)(Code)(Java Doc) public void addFunctionCall(String funcName, Object param1, Object param2)(Code)(Java Doc) public void addFunctionCall(String funcName, Object param1, Object param2, Object param3)(Code)(Java Doc) public void addFunctionCall(String funcName, Object param1, Object param2, Object param3, Object param4)(Code)(Java Doc) public void addFunctionCall(String funcName, Object param1, Object param2, Object param3, Object param4, Object param5)(Code)(Java Doc) public void addFunctionCall(String funcName, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6)(Code)(Java Doc) public void addFunctionCall(String funcName, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6, Object param7)(Code)(Java Doc) public void addScript(ScriptBuffer script)(Code)(Java Doc) public void addScriptSession(ScriptSession scriptSession)(Code)(Java Doc) public void addScriptSessions(Collection<ScriptSession> addScriptSessions)(Code)(Java Doc)
|
|
|