public class RpcRequestBuilder
extends java.lang.Object
doXyz methods and pass an instance of the subclass to
ServiceDefTarget.setRpcRequestBuilder(com.google.gwt.user.client.rpc.RpcRequestBuilder).| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
CONTENT_TYPE_HEADER
|
static java.lang.String |
MODULE_BASE_HEADER
|
static java.lang.String |
STRONG_NAME_HEADER
|
| 构造器和说明 |
|---|
RpcRequestBuilder() |
| 限定符和类型 | 方法和说明 |
|---|---|
RpcRequestBuilder |
create(java.lang.String serviceEntryPoint)
Initialize the RpcRequestBuilder.
|
protected com.google.gwt.http.client.RequestBuilder |
doCreate(java.lang.String serviceEntryPoint)
Called by
create(java.lang.String) to instantiate the RequestBuilder object. |
protected void |
doFinish(com.google.gwt.http.client.RequestBuilder rb)
Called by
finish() prior to returning the RequestBuilder to the
caller. |
protected void |
doSetCallback(com.google.gwt.http.client.RequestBuilder rb,
com.google.gwt.http.client.RequestCallback callback)
|
protected void |
doSetContentType(com.google.gwt.http.client.RequestBuilder rb,
java.lang.String contentType)
Called by
setContentType(java.lang.String). |
protected void |
doSetRequestData(com.google.gwt.http.client.RequestBuilder rb,
java.lang.String data)
Called by
setRequestData(java.lang.String). |
protected void |
doSetRequestId(com.google.gwt.http.client.RequestBuilder rb,
int id)
Called by
setRequestId(int). |
com.google.gwt.http.client.RequestBuilder |
finish()
This method must be called to return the RequestBuilder that the RPC
request will be made with.
|
RpcRequestBuilder |
setCallback(com.google.gwt.http.client.RequestCallback callback)
Sets the RequestCallback to be used by the RequestBuilder.
|
RpcRequestBuilder |
setContentType(java.lang.String contentType)
Sets the MIME content type to be used by the RequestBuilder.
|
RpcRequestBuilder |
setRequestData(java.lang.String data)
Sets the request data to be sent in the request.
|
RpcRequestBuilder |
setRequestId(int id)
Sets the request id of the request.
|
RpcRequestBuilder |
setSync(boolean sync) |
public static final java.lang.String CONTENT_TYPE_HEADER
public static final java.lang.String MODULE_BASE_HEADER
public static final java.lang.String STRONG_NAME_HEADER
public final RpcRequestBuilder create(java.lang.String serviceEntryPoint)
create
before calling finish() will reset the state of the
RpcRequestBuilder.
This method delegates to doCreate(java.lang.String) to instantiate the
RequestBuilder.
serviceEntryPoint - The URL entry pointthisServiceDefTarget.setServiceEntryPoint(String)public final com.google.gwt.http.client.RequestBuilder finish()
This method will call doFinish(com.google.gwt.http.client.RequestBuilder) before returning the current
RequestBuilder.
public final RpcRequestBuilder setCallback(com.google.gwt.http.client.RequestCallback callback)
doSetCallback(com.google.gwt.http.client.RequestBuilder, com.google.gwt.http.client.RequestCallback).callback - the RequestCallback to be used by the RequestBuilderthispublic final RpcRequestBuilder setContentType(java.lang.String contentType)
doSetContentType(com.google.gwt.http.client.RequestBuilder, java.lang.String).contentType - the MIME content type to be used in the requestthispublic final RpcRequestBuilder setRequestData(java.lang.String data)
doSetRequestData(com.google.gwt.http.client.RequestBuilder, java.lang.String).data - the data to sendthispublic final RpcRequestBuilder setRequestId(int id)
doSetRequestId(com.google.gwt.http.client.RequestBuilder, int).id - the issue number of the requestthisprotected com.google.gwt.http.client.RequestBuilder doCreate(java.lang.String serviceEntryPoint)
create(java.lang.String) to instantiate the RequestBuilder object.
The default implementation creates a POST RequestBuilder with
the given entry point.
serviceEntryPoint - the URL to which the request should be issuedprotected void doFinish(com.google.gwt.http.client.RequestBuilder rb)
finish() prior to returning the RequestBuilder to the
caller.
The default implementation sets the "X-GWT-Permutation" header to
the value returned by GWT.getPermutationStrongName().
rb - The RequestBuilder that is currently being configuredprotected void doSetCallback(com.google.gwt.http.client.RequestBuilder rb,
com.google.gwt.http.client.RequestCallback callback)
setCallback(com.google.gwt.http.client.RequestCallback).
The default implementation calls
RequestBuilder.setCallback(RequestCallback).
rb - the RequestBuilder that is currently being configuredcallback - the user-provided callbackprotected void doSetContentType(com.google.gwt.http.client.RequestBuilder rb,
java.lang.String contentType)
setContentType(java.lang.String).
The default implementation sets the "Content-Type" header to
the value specified by contentType by calling
RequestBuilder.setHeader(String, String).
rb - the RequestBuilder that is currently being configuredcontentType - the desired MIME type of the request's contentsprotected void doSetRequestData(com.google.gwt.http.client.RequestBuilder rb,
java.lang.String data)
setRequestData(java.lang.String).
The default implementation invokes
RequestBuilder.setRequestData(String).
rb - the RequestBuilder that is currently being configureddata - the data to sendprotected void doSetRequestId(com.google.gwt.http.client.RequestBuilder rb,
int id)
setRequestId(int).
The default implementation is a no-op.
rb - the RequestBuilder that is currently being configuredid - the request's issue idpublic final RpcRequestBuilder setSync(boolean sync)