public abstract class

RemoteServiceProxy

extends Object
implements HasRpcToken SerializationStreamFactory ServiceDefTarget
java.lang.Object
   ↳ com.google.gwt.user.client.rpc.impl.RemoteServiceProxy
Known Direct Subclasses

Class Overview

Superclass for client-side RemoteService proxies. For internal use only.

Summary

Protected Constructors
RemoteServiceProxy(String moduleBaseURL, String remoteServiceRelativePath, String serializationPolicyName, Serializer serializer)
Public Methods
static JavaScriptObject bytesStat(String method, int count, int bytes, String eventType)
This method is deprecated. use RpcStatsContext.
SerializationStreamReader createStreamReader(String encoded)
Returns a SerializationStreamReader that is ready for reading.
SerializationStreamWriter createStreamWriter()
Returns a SerializationStreamWriter that has had prepareToWrite() called on it and it has already had had the name of the remote service interface written as well.
RpcToken getRpcToken()
Return RPC token used with this RPC instance.
RpcTokenExceptionHandler getRpcTokenExceptionHandler()
Return RPC token exception handler used with this RPC instance.
String getSerializationPolicyName()
Return the strong name of the serialization policy to be used with this RPC instance.
String getServiceEntryPoint()
Gets the URL of a service implementation.
static boolean isStatsAvailable()
This method is deprecated. use RpcStatsContext.
void setRpcRequestBuilder(RpcRequestBuilder builder)
Sets the RpcRequestBuilder that should be used by the service implementation.
void setRpcToken(RpcToken token)
Sets the RpcToken to be included with each RPC call.
void setRpcTokenExceptionHandler(RpcTokenExceptionHandler handler)
Sets the handler for exceptions that occurred during RPC token processing.
void setServiceEntryPoint(String url)
Sets the URL of a service implementation.
static boolean stats(JavaScriptObject data)
This method is deprecated. use {link RpcStatsContext}.
static JavaScriptObject timeStat(String method, int count, String eventType)
This method is deprecated. use RpcStatsContext.
Protected Methods
void checkRpcTokenType(RpcToken token)
This method is overridden by generated proxy classes to ensure that current service's RpcToken is of the type specified in RpcToken.RpcTokenImplementation annotation.
<T> RequestCallback doCreateRequestCallback(RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, AsyncCallback<T> callback)
<T> Request doInvoke(RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, String requestData, AsyncCallback<T> callback)
Performs a remote service method invocation.
<T> RequestBuilder doPrepareRequestBuilder(RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, String requestData, AsyncCallback<T> callback)
Configures a RequestBuilder to send an RPC request when the RequestBuilder is intended to be returned through the asynchronous proxy interface.
static int getNextRequestId()
static int getRequestId()
This method is deprecated. Use RpcRequestBuilder instead.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gwt.user.client.rpc.HasRpcToken
From interface com.google.gwt.user.client.rpc.SerializationStreamFactory
From interface com.google.gwt.user.client.rpc.ServiceDefTarget

Protected Constructors

protected RemoteServiceProxy (String moduleBaseURL, String remoteServiceRelativePath, String serializationPolicyName, Serializer serializer)

Public Methods

public static JavaScriptObject bytesStat (String method, int count, int bytes, String eventType)

This method is deprecated.
use RpcStatsContext.

public SerializationStreamReader createStreamReader (String encoded)

Returns a SerializationStreamReader that is ready for reading.

Parameters
encoded string that encodes the response of an RPC request
Returns

public SerializationStreamWriter createStreamWriter ()

Returns a SerializationStreamWriter that has had prepareToWrite() called on it and it has already had had the name of the remote service interface written as well.

Returns

public RpcToken getRpcToken ()

Return RPC token used with this RPC instance.

Returns
  • RPC token or null if none set.
See Also
  • ServiceDefTarget#getRpcToken()

public RpcTokenExceptionHandler getRpcTokenExceptionHandler ()

Return RPC token exception handler used with this RPC instance.

Returns
  • Exception handler or null if none set.
See Also
  • ServiceDefTarget#getRpcTokenExceptionHandler()

public String getSerializationPolicyName ()

Return the strong name of the serialization policy to be used with this RPC instance.

public String getServiceEntryPoint ()

Gets the URL of a service implementation.

Returns

public static boolean isStatsAvailable ()

This method is deprecated.
use RpcStatsContext.

Indicates if RPC statistics should be gathered.

public void setRpcRequestBuilder (RpcRequestBuilder builder)

Sets the RpcRequestBuilder that should be used by the service implementation. This method can be called if customized request behavior is desired. Calling this method with a null value will reset any custom behavior to the default implementation.

public void setRpcToken (RpcToken token)

Sets the RpcToken to be included with each RPC call.

public void setRpcTokenExceptionHandler (RpcTokenExceptionHandler handler)

Sets the handler for exceptions that occurred during RPC token processing.

public void setServiceEntryPoint (String url)

Sets the URL of a service implementation.

Parameters
url a URL that designates the service implementation to call

public static boolean stats (JavaScriptObject data)

This method is deprecated.
use {link RpcStatsContext}.

public static JavaScriptObject timeStat (String method, int count, String eventType)

This method is deprecated.
use RpcStatsContext.

Protected Methods

protected void checkRpcTokenType (RpcToken token)

This method is overridden by generated proxy classes to ensure that current service's RpcToken is of the type specified in RpcToken.RpcTokenImplementation annotation.

Parameters
token currently set RpcToken.
Throws
if types mismatch.

protected RequestCallback doCreateRequestCallback (RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, AsyncCallback<T> callback)

protected Request doInvoke (RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, String requestData, AsyncCallback<T> callback)

Performs a remote service method invocation. This method is called by generated proxy classes.

Parameters
responseReader instance used to read the return value of the invocation
requestData payload that encodes the addressing and arguments of the RPC call
callback callback handler
Returns
  • a Request object that can be used to track the request

protected RequestBuilder doPrepareRequestBuilder (RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, String requestData, AsyncCallback<T> callback)

Configures a RequestBuilder to send an RPC request when the RequestBuilder is intended to be returned through the asynchronous proxy interface.

Parameters
responseReader instance used to read the return value of the invocation
requestData payload that encodes the addressing and arguments of the RPC call
callback callback handler
Returns
  • a RequestBuilder object that is ready to have its send() method invoked.

protected static int getNextRequestId ()

protected static int getRequestId ()

This method is deprecated.
Use RpcRequestBuilder instead.