次の方法で共有


ServiceProxyBase クラス

  • java.lang.Object
    • ProxyBase
      • microsoft.servicefabric.services.remoting.client.ServiceProxyBase

public class ServiceProxyBase extends ProxyBase implements ServiceProxy

リモート IService インターフェイスへのプロキシの基本実装を提供します。

メソッドの概要

修飾子と型 メソッドと説明
static<T extends Service> T create(Class<T> serviceInterfaceType, URI serviceUri)
static<T extends Service> T create(Class<T> serviceInterfaceType, URI serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName)

サービスが実装するリモート インターフェイス TServiceInterface を使用して、指定されたサービスと通信するプロキシを作成します。

Object createRequestMessageBody(Object requestMessageBodyValue)
Object deserializeMessage(byte[] msgBodyValue)
Object getResponseMessageBodyValue(Object responseMessageBody)
Class<?> getServiceInterfaceType()

リモート化されているインターフェイスの種類。

ServiceRemotingPartitionClient getServicePartitionClient()

サービスに要求を送信するために使用されるサービス パーティション クライアント。

void initialize(ServiceProxyGenerator serviceProxyGenerator, FabricServiceRemotingPartitionClient remotingPartitionClient)

サービス プロキシ インスタンスを初期化するメソッド。 これは内部使用用です。

void invoke(int interfaceId, int methodId, byte[] requestMsgBodyBytes)
CompletableFuture<byte[]> invokeAsync(int interfaceId, int methodId, byte[] requestMsgBodyBytes, CancellationToken cancellationToken)
byte [] serializeMessage(Object msgBodyValue)

継承メンバー

メソッドの詳細

create

public static static T create(Class serviceInterfaceType, URI serviceUri)

パラメーター:

serviceInterfaceType
serviceUri

create

public static static T create(Class serviceInterfaceType, URI serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName)

サービスが実装するリモート インターフェイス TServiceInterface を使用して、指定されたサービスと通信するプロキシを作成します。

パラメーター:

serviceInterfaceType - リモート化されているインターフェイスの種類
serviceUri - サービスの URI。
partitionKey - このサービス プロキシからの要求を処理するサービス パーティションを決定するパーティション キー
targetReplicaSelector - クライアントが接続するサービス パーティションのレプリカまたはインスタンスを決定します。
listenerName - サービスに 1 つの通信リスナーがある場合、このパラメーターは省略可能です。 サービスのエンドポイントは、{"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}} の形式です。 サービスが複数のエンドポイントを公開する場合、このパラメーターはリモート処理通信に使用するエンドポイントを識別します。

戻り値:

リモート化されているインターフェイスを実装するプロキシ。 返されるオブジェクトは、インターフェイスも実装 ServiceProxy します。

createRequestMessageBody

protected Object createRequestMessageBody(Object requestMessageBodyValue)

パラメーター:

requestMessageBodyValue

deserializeMessage

protected Object deserializeMessage(byte[] msgBodyValue)

パラメーター:

msgBodyValue

getResponseMessageBodyValue

protected Object getResponseMessageBodyValue(Object responseMessageBody)

パラメーター:

responseMessageBody

getServiceInterfaceType

public Class getServiceInterfaceType()

リモート化されているインターフェイスの種類。

上書き:

ServiceProxyBase.getServiceInterfaceType()

戻り値:

サービス インターフェイスの種類。

getServicePartitionClient

public ServiceRemotingPartitionClient getServicePartitionClient()

サービスに要求を送信するために使用されるサービス パーティション クライアント。

上書き:

ServiceProxyBase.getServicePartitionClient()

戻り値:

ServiceProxy によって使用される ServicePartitionClient。

initialize

public void initialize(ServiceProxyGenerator serviceProxyGenerator, FabricServiceRemotingPartitionClient remotingPartitionClient)

サービス プロキシ インスタンスを初期化するメソッド。 これは内部使用用です。

パラメーター:

serviceProxyGenerator - serviceProxyGenerator のインスタンス
remotingPartitionClient - サービス プロキシによって使用される remotingPartitionClient。

invoke

protected void invoke(int interfaceId, int methodId, byte[] requestMsgBodyBytes)

パラメーター:

interfaceId
methodId
requestMsgBodyBytes

invokeAsync

protected CompletableFuture invokeAsync(int interfaceId, int methodId, byte[] requestMsgBodyBytes, CancellationToken cancellationToken)

パラメーター:

interfaceId
methodId
requestMsgBodyBytes
cancellationToken

serializeMessage

protected byte [] serializeMessage(Object msgBodyValue)

パラメーター:

msgBodyValue

適用対象