org.xmlBlaster.client
Class JavascriptCallback
java.lang.Object
org.xmlBlaster.client.JavascriptCallback
- All Implemented Interfaces:
- I_Callback
public class JavascriptCallback
- extends java.lang.Object
- implements I_Callback
Forwards callback messages to Javascript code.
We use this dispatcher for example in the SVG example
xmlBlaster/demo/javaclients/svg/rhino/chessRhino.svg
.
- Author:
- Michele Laghi.
- See Also:
http://xml.apache.org/batik
Constructor Summary |
JavascriptCallback(org.apache.batik.script.rhino.WindowWrapper javascriptWindow)
This constructor is called from Javascript within a SVG document: |
Method Summary |
void |
setElementValue(org.w3c.dom.Element ele,
java.lang.String value)
|
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
This is the callback method invoked from xmlBlaster
delivering us a new asynchronous message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavascriptCallback
public JavascriptCallback(org.apache.batik.script.rhino.WindowWrapper javascriptWindow)
- This constructor is called from Javascript within a SVG document:
... // other Javascript code with Rhino live connect
xmlBlaster.connect(connectQos, new JavascriptCallback(this));
where this == window (the global object in SVG and HTML browsers)
and window is of type WindowWrapper.
The problem is that WindowWrapper has no method to retrieve the
Javascript context like SVGCanvas or UpdateManager, so we get this
via the static method getCurrentContext().
- See Also:
http://xml.apache.org/batik
setElementValue
public void setElementValue(org.w3c.dom.Element ele,
java.lang.String value)
update
public java.lang.String update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
throws XmlBlasterException
- This is the callback method invoked from xmlBlaster
delivering us a new asynchronous message.
- Specified by:
update
in interface I_Callback
- Parameters:
cbSessionId
- The session ID specified by the client which registered the callbackupdateKey
- The arrived keycontent
- The arrived message contentqos
- Quality of Service of the MsgUnit
- Throws:
XmlBlasterException
- See Also:
I_Callback.update(String, UpdateKey, byte[], org.xmlBlaster.client.qos.UpdateQos)
Copyright © 1999-2014 The xmlBlaster.org contributers.