T
- the type of the response object.public class JsonpRequest<T>
extends java.lang.Object
Constructor and Description |
---|
JsonpRequest(AsyncCallback<T> callback,
int timeout,
boolean expectInteger,
java.lang.String callbackParam,
java.lang.String failureCallbackParam)
Create a new JSONP request.
|
JsonpRequest(AsyncCallback<T> callback,
int timeout,
boolean expectInteger,
java.lang.String callbackParam,
java.lang.String failureCallbackParam,
java.lang.String id)
Create a new JSONP request with a hardcoded id.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels a pending request.
|
AsyncCallback<T> |
getCallback() |
(package private) java.lang.String |
getCallbackId() |
int |
getTimeout() |
(package private) void |
send(java.lang.String baseUri)
Sends a request using the JSONP mechanism.
|
java.lang.String |
toString() |
JsonpRequest(AsyncCallback<T> callback, int timeout, boolean expectInteger, java.lang.String callbackParam, java.lang.String failureCallbackParam)
callback
- The callback instance to notify when the response comes
backtimeout
- Time in ms after which a TimeoutException
will be
thrownexpectInteger
- Should be true if T is Integer
, false
otherwisecallbackParam
- Name of the url param of the callback function namefailureCallbackParam
- Name of the url param containing the
failure callback function name, or null for no failure callbackJsonpRequest(AsyncCallback<T> callback, int timeout, boolean expectInteger, java.lang.String callbackParam, java.lang.String failureCallbackParam, java.lang.String id)
callback
- The callback instance to notify when the response comes
backtimeout
- Time in ms after which a TimeoutException
will be
thrownexpectInteger
- Should be true if T is Integer
, false
otherwisecallbackParam
- Name of the url param of the callback function namefailureCallbackParam
- Name of the url param containing the
failure callback function name, or null for no failure callbackid
- unique id for the resource that is being fetchedpublic void cancel()
public AsyncCallback<T> getCallback()
public int getTimeout()
public java.lang.String toString()
toString
in class java.lang.Object
java.lang.String getCallbackId()
void send(java.lang.String baseUri)
baseUri
- To be sent to the server.