use of org.directwebremoting.ScriptSession in project ma-core-public by infiniteautomation.
the class ScriptProxy method addScript.
/**
* Utility to add the given script to all known browsers.
* @param script The Javascript to send to the browsers
*/
public void addScript(ScriptBuffer script) {
for (Iterator it = scriptSessions.iterator(); it.hasNext(); ) {
ScriptSession scriptSession = (ScriptSession) it.next();
scriptSession.addScript(script);
}
}
use of org.directwebremoting.ScriptSession in project aries by apache.
the class ServerSideClass method addFunctionCall.
private void addFunctionCall(String name, Object... params) {
final ScriptBuffer script = new ScriptBuffer();
script.appendScript(name).appendScript("(");
for (int i = 0; i < params.length; i++) {
if (i != 0)
script.appendScript(",");
script.appendData(params[i]);
}
script.appendScript(");");
Browser.withAllSessions(new Runnable() {
public void run() {
for (ScriptSession s : Browser.getTargetSessions()) {
s.addScript(script);
}
}
});
}
Aggregations