你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ServiceRemotingProviderAttribute 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
这是 属性的基类型,用于设置默认服务远程处理提供程序,用于远程处理程序集中定义和使用的服务接口。
[System.AttributeUsage(System.AttributeTargets.Assembly)]
public abstract class ServiceRemotingProviderAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Assembly)>]
type ServiceRemotingProviderAttribute = class
inherit Attribute
Public MustInherit Class ServiceRemotingProviderAttribute
Inherits Attribute
- 继承
-
ServiceRemotingProviderAttribute
- 派生
- 属性
注解
在服务端,运行时上的 CreateServiceRemotingReplicaListeners<TStatefulService>(TStatefulService) 和 CreateServiceRemotingInstanceListeners<TStatelessService>(TStatelessService) 方法查找此属性的实现,以便为有状态和无状态服务创建默认值 IServiceRemotingListener 。
在客户端,构造函数会查找 Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceProxyFactory 此属性的实现,以在未指定时创建默认值 IServiceRemotingClientFactory 。
请注意,在客户端 Create<TServiceInterface>(Uri, ServicePartitionKey, TargetReplicaSelector, String) 方法上创建一次默认值 Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceProxyFactory ,因此提供程序查找仅在第一次发生,之后使用相同的提供程序。
此属性的查找顺序如下:
构造函数
ServiceRemotingProviderAttribute() |
初始化 ServiceRemotingProviderAttribute 类的新实例。 |
属性
RemotingClientVersion |
获取或设置要使用的远程处理客户端的版本。 |
RemotingListenerVersion |
获取或设置远程处理侦听器要使用的版本。 |
方法
CreateServiceRemotingClientFactoryV2(IServiceRemotingCallbackMessageHandler) |
创建一个 V2 服务远程处理客户端工厂,该 Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceProxyFactory 工厂可由 用于为服务的远程接口创建代理。 |
CreateServiceRemotingListeners() |
返回创建远程侦听器的 func 方法。 |