Class RpcRequestBuilder
doXyz methods and pass an instance of the subclass to
ServiceDefTarget.setRpcRequestBuilder(com.google.gwt.user.client.rpc.RpcRequestBuilder).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal RpcRequestBuilderInitialize the RpcRequestBuilder.protected RequestBuilderCalled bycreate(java.lang.String)to instantiate the RequestBuilder object.protected voidCalled byfinish()prior to returning the RequestBuilder to the caller.protected voiddoSetCallback(RequestBuilder rb, RequestCallback callback) protected voiddoSetContentType(RequestBuilder rb, String contentType) Called bysetContentType(java.lang.String).protected voiddoSetRequestData(RequestBuilder rb, String data) Called bysetRequestData(java.lang.String).protected voiddoSetRequestId(RequestBuilder rb, int id) Called bysetRequestId(int).final RequestBuilderfinish()This method must be called to return the RequestBuilder that the RPC request will be made with.final RpcRequestBuildersetCallback(RequestCallback callback) Sets the RequestCallback to be used by the RequestBuilder.final RpcRequestBuildersetContentType(String contentType) Sets the MIME content type to be used by the RequestBuilder.final RpcRequestBuildersetRequestData(String data) Sets the request data to be sent in the request.final RpcRequestBuildersetRequestId(int id) Sets the request id of the request.
-
Field Details
-
CONTENT_TYPE_HEADER
- See Also:
-
MODULE_BASE_HEADER
- See Also:
-
STRONG_NAME_HEADER
- See Also:
-
-
Constructor Details
-
RpcRequestBuilder
public RpcRequestBuilder()
-
-
Method Details
-
create
Initialize the RpcRequestBuilder. This method must be called before any of the other methods in this class may be called. Callingcreatebefore callingfinish()will reset the state of the RpcRequestBuilder.This method delegates to
doCreate(java.lang.String)to instantiate the RequestBuilder.- Parameters:
serviceEntryPoint- The URL entry point- Returns:
this- See Also:
-
finish
This method must be called to return the RequestBuilder that the RPC request will be made with.This method will call
doFinish(com.google.gwt.http.client.RequestBuilder)before returning the current RequestBuilder. -
setCallback
Sets the RequestCallback to be used by the RequestBuilder. Delegates todoSetCallback(com.google.gwt.http.client.RequestBuilder, com.google.gwt.http.client.RequestCallback).- Parameters:
callback- the RequestCallback to be used by the RequestBuilder- Returns:
this
-
setContentType
Sets the MIME content type to be used by the RequestBuilder. Delegates todoSetContentType(com.google.gwt.http.client.RequestBuilder, java.lang.String).- Parameters:
contentType- the MIME content type to be used in the request- Returns:
this
-
setRequestData
Sets the request data to be sent in the request. Delegates todoSetRequestData(com.google.gwt.http.client.RequestBuilder, java.lang.String).- Parameters:
data- the data to send- Returns:
this
-
setRequestId
Sets the request id of the request. Delegates todoSetRequestId(com.google.gwt.http.client.RequestBuilder, int).- Parameters:
id- the issue number of the request- Returns:
this
-
doCreate
Called bycreate(java.lang.String)to instantiate the RequestBuilder object.The default implementation creates a
POSTRequestBuilder with the given entry point.- Parameters:
serviceEntryPoint- the URL to which the request should be issued- Returns:
- the RequestBuilder that should be ultimately passed to the RpcRequestBuilder's caller.
-
doFinish
Called byfinish()prior to returning the RequestBuilder to the caller.The default implementation sets the "X-GWT-Permutation" header to the value returned by
GWT.getPermutationStrongName().- Parameters:
rb- The RequestBuilder that is currently being configured
-
doSetCallback
Called bysetCallback(com.google.gwt.http.client.RequestCallback).The default implementation calls
RequestBuilder.setCallback(RequestCallback).- Parameters:
rb- the RequestBuilder that is currently being configuredcallback- the user-provided callback
-
doSetContentType
Called bysetContentType(java.lang.String).The default implementation sets the "Content-Type" header to the value specified by
contentTypeby callingRequestBuilder.setHeader(String, String).- Parameters:
rb- the RequestBuilder that is currently being configuredcontentType- the desired MIME type of the request's contents
-
doSetRequestData
Called bysetRequestData(java.lang.String).The default implementation invokes
RequestBuilder.setRequestData(String).- Parameters:
rb- the RequestBuilder that is currently being configureddata- the data to send
-
doSetRequestId
Called bysetRequestId(int).The default implementation is a no-op.
- Parameters:
rb- the RequestBuilder that is currently being configuredid- the request's issue id
-