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

ServiceProxyFactory Interface

public interface ServiceProxyFactory

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

Method Summary

Modifier and Type Method and Description
public<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>

public<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>

Method Details

createServiceProxy

public 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>

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 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>

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