public abstract class RemoteServiceProxy extends Object implements SerializationStreamFactory, ServiceDefTarget, HasRpcToken
RemoteService
proxies.
For internal use only.Modifier and Type | Class and Description |
---|---|
class |
RemoteServiceProxy.ServiceHelper
A helper class that prepares the service to serialize data.
|
ServiceDefTarget.NoServiceEntryPointSpecifiedException
Modifier | Constructor and Description |
---|---|
protected |
RemoteServiceProxy(String moduleBaseURL,
String remoteServiceRelativePath,
String serializationPolicyName,
Serializer serializer) |
Modifier and Type | Method and Description |
---|---|
static JavaScriptObject |
bytesStat(String method,
int count,
int bytes,
String eventType)
Deprecated.
use
RpcStatsContext . |
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. |
SerializationStreamReader |
createStreamReader(String encoded)
Returns a
SerializationStreamReader that is ready for reading. |
SerializationStreamWriter |
createStreamWriter()
Returns a
SerializationStreamWriter that has had
ClientSerializationStreamWriter.prepareToWrite() called on it and
it has already had had the name of the remote service interface written as
well. |
protected <T> RequestCallback |
doCreateRequestCallback(RequestCallbackAdapter.ResponseReader responseReader,
String methodName,
RpcStatsContext statsContext,
AsyncCallback<T> callback) |
protected <T> Request |
doInvoke(RequestCallbackAdapter.ResponseReader responseReader,
String methodName,
RpcStatsContext statsContext,
String requestData,
AsyncCallback<T> callback)
Performs a remote service method invocation.
|
protected <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.
|
protected static int |
getNextRequestId()
Deprecated.
|
protected static int |
getRequestId()
Deprecated.
Use
RpcRequestBuilder instead. |
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()
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)
Deprecated.
use
RpcStatsContext . |
static JavaScriptObject |
timeStat(String method,
int count,
String eventType)
Deprecated.
use
RpcStatsContext . |
protected RemoteServiceProxy(String moduleBaseURL, String remoteServiceRelativePath, String serializationPolicyName, Serializer serializer)
@Deprecated public static JavaScriptObject bytesStat(String method, int count, int bytes, String eventType)
RpcStatsContext
.@Deprecated public static boolean isStatsAvailable()
RpcStatsContext
.@Deprecated public static boolean stats(JavaScriptObject data)
RpcStatsContext
.isStatsAvailable()
&&
stats(JavaScriptObject)
.@Deprecated public static JavaScriptObject timeStat(String method, int count, String eventType)
RpcStatsContext
.@Deprecated protected static int getNextRequestId()
@Deprecated protected static int getRequestId()
RpcRequestBuilder
instead.public SerializationStreamReader createStreamReader(String encoded) throws SerializationException
SerializationStreamReader
that is ready for reading.createStreamReader
in interface SerializationStreamFactory
encoded
- string that encodes the response of an RPC requestSerializationStreamReader
that is ready for readingSerializationException
public SerializationStreamWriter createStreamWriter()
SerializationStreamWriter
that has had
ClientSerializationStreamWriter.prepareToWrite()
called on it and
it has already had had the name of the remote service interface written as
well.createStreamWriter
in interface SerializationStreamFactory
SerializationStreamWriter
that has had
ClientSerializationStreamWriter.prepareToWrite()
called on
it and it has already had had the name of the remote service
interface written as wellpublic RpcToken getRpcToken()
HasRpcToken
getRpcToken
in interface HasRpcToken
null
if none set.HasRpcToken.getRpcToken()
public RpcTokenExceptionHandler getRpcTokenExceptionHandler()
HasRpcToken
getRpcTokenExceptionHandler
in interface HasRpcToken
null
if none set.HasRpcToken.getRpcTokenExceptionHandler()
public String getSerializationPolicyName()
ServiceDefTarget
getSerializationPolicyName
in interface ServiceDefTarget
public String getServiceEntryPoint()
ServiceDefTarget
getServiceEntryPoint
in interface ServiceDefTarget
ServiceDefTarget.setServiceEntryPoint(String)
ServiceDefTarget.getServiceEntryPoint()
public void setRpcRequestBuilder(RpcRequestBuilder builder)
ServiceDefTarget
setRpcRequestBuilder
in interface ServiceDefTarget
public void setRpcToken(RpcToken token)
HasRpcToken
RpcToken
to be included with each RPC call.setRpcToken
in interface HasRpcToken
HasRpcToken.setRpcToken(RpcToken)
public void setRpcTokenExceptionHandler(RpcTokenExceptionHandler handler)
HasRpcToken
setRpcTokenExceptionHandler
in interface HasRpcToken
HasRpcToken.setRpcTokenExceptionHandler(RpcTokenExceptionHandler)
public void setServiceEntryPoint(String url)
ServiceDefTarget
setServiceEntryPoint
in interface ServiceDefTarget
url
- a URL that designates the service implementation to callServiceDefTarget.setServiceEntryPoint(String)
protected void checkRpcTokenType(RpcToken token)
RpcToken
is of the type specified in RpcToken.RpcTokenImplementation
annotation.token
- currently set RpcToken
.protected <T> RequestCallback doCreateRequestCallback(RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, AsyncCallback<T> callback)
protected <T> Request doInvoke(RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, String requestData, AsyncCallback<T> callback)
T
- return type for the AsyncCallbackresponseReader
- instance used to read the return value of the
invocationrequestData
- payload that encodes the addressing and arguments of the
RPC callcallback
- callback handlerRequest
object that can be used to track the requestprotected <T> RequestBuilder doPrepareRequestBuilder(RequestCallbackAdapter.ResponseReader responseReader, String methodName, RpcStatsContext statsContext, String requestData, AsyncCallback<T> callback)
T
- return type for the AsyncCallbackresponseReader
- instance used to read the return value of the
invocationrequestData
- payload that encodes the addressing and arguments of the
RPC callcallback
- callback handlerRequestBuilder.send()
method invoked.Copyright © 2018. All rights reserved.