use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class EnginePrivate method remoteHandleException.
/**
* Call the dwr.engine._remoteHandleException() in the browser
* @param conduit The browser pipe to write to
* @param batchId The identifier of the batch that we are handling a response for
* @param callId The id of the call we are replying to
* @param ex The exception to throw on the remote end
* @throws IOException If writing fails.
*/
public static void remoteHandleException(ScriptConduit conduit, String batchId, String callId, Throwable ex) throws IOException {
try {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine._remoteHandleException(\'").appendScript(batchId).appendScript("\',\'").appendScript(callId).appendScript("\',").appendData(ex).appendScript(");");
conduit.addScript(script);
} catch (MarshallException mex) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine._remoteHandleException(\'").appendScript(batchId).appendScript("\',\'").appendScript(callId).appendScript("\',").appendData(mex).appendScript(");");
addScriptWithoutException(conduit, script);
}
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class ScriptProxy method addFunctionCall.
/**
* Call a named function with no parameters.
* @param funcName The name of the function to call
*/
public void addFunctionCall(String funcName) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript(funcName).appendScript("();");
addScript(script);
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class Engine method setPollUsingComet.
/**
* Does DWR us comet polling? (Default: true)
* @param pollComet True/False to use Comet where supported
* @see <a href="http://getahead.org/dwr/browser/engine/options">Options documentation</a>
*/
public void setPollUsingComet(boolean pollComet) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine.setPollUsingComet(").appendData(pollComet).appendScript(");");
addScript(script);
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class Engine method setRpcType.
/**
* Set the preferred remoting type.
* @param newType One of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag
* @see <a href="http://getahead.org/dwr/browser/engine/options">Options documentation</a>
*/
public void setRpcType(int newType) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine.setRpcType(").appendData(newType).appendScript(");");
addScript(script);
}
use of org.directwebremoting.ScriptBuffer in project ma-core-public by infiniteautomation.
the class Engine method setActiveReverseAjax.
/**
* Does DWR poll the server for updates? (Default: false)
* @param activeReverseAjax True/False to turn RA on/off
* @see <a href="http://getahead.org/dwr/browser/engine/options">Options documentation</a>
*/
public void setActiveReverseAjax(boolean activeReverseAjax) {
ScriptBuffer script = new ScriptBuffer();
script.appendScript("dwr.engine.setActiveReverseAjax(").appendData(activeReverseAjax).appendScript(");");
addScript(script);
}
Aggregations