你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

FabricServiceProxyFactory Class

  • java.lang.Object
    • ServiceProxyFactory
      • microsoft.servicefabric.services.remoting.client.FabricServiceProxyFactory

public class FabricServiceProxyFactory implements ServiceProxyFactory

Specifies the factory that creates proxies for remote communication to the specified service.

Constructor Summary

Constructor Description
FabricServiceProxyFactory()

Instantiates the ServiceProxyFactory with the specified remoting factory and retrysettings.

FabricServiceProxyFactory(Function<ServiceRemotingCallbackClient, ServiceRemotingClientFactory> createServiceRemotingClientFactory, OperationRetrySettings retrySettings)

Instantiates the ServiceProxyFactory with the specified remoting factory and retrysettings.

Method Summary

Modifier and Type Method and Description
<T extends Service> T createServiceProxy(Class<T> serviceInterfaceType, URI serviceUri)

Creates a proxy to communicate to the specified service using the remoted interface<T> 

</code> that the service implements.</p>

<T extends Service> T createServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName)

Creates a proxy to communicate to the specified service using the remoted interface<T> 

</code> that the service implements.</p>

Constructor Details

FabricServiceProxyFactory

public FabricServiceProxyFactory()

Instantiates the ServiceProxyFactory with the specified remoting factory and retrysettings.

FabricServiceProxyFactory

public FabricServiceProxyFactory(Function createServiceRemotingClientFactory, OperationRetrySettings retrySettings)

Instantiates the ServiceProxyFactory with the specified remoting factory and retrysettings.

Parameters:

createServiceRemotingClientFactory - Specifies the factory method that creates the remoting client factory. The remoting client factory got from this method is cached in the ServiceProxyFactory.
retrySettings - Specifies the retry policy to use on exceptions seen when using the proxies created by this factory

Method Details

createServiceProxy

public T createServiceProxy(Class serviceInterfaceType, URI serviceUri)

Creates a proxy to communicate to the specified service using the remoted interface<T> 

</code> that the service implements.</p>

Overrides:

FabricServiceProxyFactory.createServiceProxy(Class<T> serviceInterfaceType, URI serviceUri)

Parameters:

serviceInterfaceType - Interface type that is being remoted
serviceUri - Uri of the Service.

Returns:

The proxy that implement the interface that is being remoted. The returned object also implement ServiceProxy interface.

createServiceProxy

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

Creates a proxy to communicate to the specified service using the remoted interface<T> 

</code> that the service implements.</p>

Overrides:

FabricServiceProxyFactory.createServiceProxy(Class<T> serviceInterfaceType, URI serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName)

Parameters:

serviceInterfaceType - Interface type that is being remoted
serviceUri - Uri of the Service.
partitionKey - The Partition key that determines which service partition is responsible for handling requests from this service proxy.
targetReplicaSelector - Determines which replica or instance of the service partition the client should connect to.
listenerName - This parameter is Optional if the service has a single communication listener. The endpoints from the service are of the form {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}. When the service exposes multiple endpoints, this parameter identifies which of those endpoints to use for the remoting communication.

Returns:

The proxy that implement the interface that is being remoted. The returned object also implement ServiceProxy interface.

Applies to