org.directwebremoting.ui.dwr
Class Engine

java.lang.Object
  extended by org.directwebremoting.ui.dwr.Engine

public class Engine
extends java.lang.Object

Engine is a server-side proxy that allows Java programmers to call client side Javascript from Java.

Author:
Joe Walker [joe at getahead dot ltd dot uk]
See Also:
for more documenation on server-side proxies

Field Summary
static int IFrame
          XHR remoting type constant.
static int ScriptTag
          XHR remoting type constant.
static int XMLHttpRequest
          XHR remoting type constant.
 
Constructor Summary
Engine()
           
 
Method Summary
static void openInDownload(byte[] blob)
          Send some data to the client and have the browser offer it for download
static void openInDownload(FileTransfer ft)
          Send some data to the client and have the browser offer it for download
static void openInDownload(java.io.InputStream in)
          Send some data to the client and have the browser offer it for download
static void setActiveReverseAjax(boolean activeReverseAjax)
          Does DWR poll the server for updates? (Default: false)
static void setAsync(boolean async)
          Do we ask the XHR object to be asynchronous? (Default: true)
static void setHttpMethod(java.lang.String httpMethod)
          Which HTTP method do we use to send results? Must be one of "GET" or "POST".
static void setOrdered(boolean ordered)
          Ensure that remote calls happen in the order in which they were sent? (Default: false)
static void setPollType(int newPollType)
          Set the preferred polling type.
static void setPollUsingComet(boolean pollComet)
          Does DWR us comet polling? (Default: true)
static void setRpcType(int newType)
          Set the preferred remoting type.
static void setTimeout(int timeout)
          Set a default timeout value for all calls.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLHttpRequest

public static final int XMLHttpRequest
XHR remoting type constant. See dwr.engine.set[Rpc|Poll]Type()

See Also:
Constant Field Values

IFrame

public static final int IFrame
XHR remoting type constant. See dwr.engine.set[Rpc|Poll]Type()

See Also:
Constant Field Values

ScriptTag

public static final int ScriptTag
XHR remoting type constant. See dwr.engine.setRpcType()

See Also:
Constant Field Values
Constructor Detail

Engine

public Engine()
Method Detail

openInDownload

public static void openInDownload(byte[] blob)
Send some data to the client and have the browser offer it for download

Parameters:
blob - The data to be downloaded

openInDownload

public static void openInDownload(java.io.InputStream in)
Send some data to the client and have the browser offer it for download

Parameters:
in - The data to be downloaded

openInDownload

public static void openInDownload(FileTransfer ft)
Send some data to the client and have the browser offer it for download

Parameters:
ft - The data to be downloaded

setTimeout

public static void setTimeout(int timeout)
Set a default timeout value for all calls. 0 (the default) turns timeouts off.

Parameters:
timeout - The time to wait in milliseconds

setRpcType

public static void setRpcType(int newType)
Set the preferred remoting type.

Parameters:
newType - One of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag

setHttpMethod

public static void setHttpMethod(java.lang.String httpMethod)
Which HTTP method do we use to send results? Must be one of "GET" or "POST".

Parameters:
httpMethod - One of XMLHttpRequest, IFrame or ScriptTag

setOrdered

public static void setOrdered(boolean ordered)
Ensure that remote calls happen in the order in which they were sent? (Default: false)

Parameters:
ordered - True to set call ordering.

setAsync

public static void setAsync(boolean async)
Do we ask the XHR object to be asynchronous? (Default: true)

Parameters:
async - False to become synchronous (not recommended)

setActiveReverseAjax

public static void setActiveReverseAjax(boolean activeReverseAjax)
Does DWR poll the server for updates? (Default: false)

Parameters:
activeReverseAjax - True/False to turn RA on/off

setPollUsingComet

public static void setPollUsingComet(boolean pollComet)
Does DWR us comet polling? (Default: true)

Parameters:
pollComet - True/False to use Comet where supported

setPollType

public static void setPollType(int newPollType)
Set the preferred polling type.

Parameters:
newPollType - One of XMLHttpRequest, IFrame or ScriptTag

Copyright ยจ 2008