Condividi tramite


CommunicationClientFactoryBase<TCommunicationClient> Class

Definition

Provides the base implementation of ICommunicationClientFactory for creating communication clients to talk to service fabric services. Extend the CommunicationClientFactoryBase class to create communication clients for custom transport implementations. This class maintains a cache of communication clients and attempts to reuse the clients for requests to the same service endpoint.

public abstract class CommunicationClientFactoryBase<TCommunicationClient> : Microsoft.ServiceFabric.Services.Communication.Client.ICommunicationClientFactory<TCommunicationClient> where TCommunicationClient : ICommunicationClient
type CommunicationClientFactoryBase<'CommunicationClient (requires 'CommunicationClient :> ICommunicationClient)> = class
    interface ICommunicationClientFactory<'CommunicationClient (requires 'CommunicationClient :> ICommunicationClient)>
Public MustInherit Class CommunicationClientFactoryBase(Of TCommunicationClient)
Implements ICommunicationClientFactory(Of TCommunicationClient)

Type Parameters

TCommunicationClient

The type of communication client

Inheritance
CommunicationClientFactoryBase<TCommunicationClient>
Derived
Implements

Constructors

CommunicationClientFactoryBase<TCommunicationClient>(Boolean, IServicePartitionResolver, IEnumerable<IExceptionHandler>, String)

Initializes a new instance of the CommunicationClientFactoryBase<TCommunicationClient> class.

CommunicationClientFactoryBase<TCommunicationClient>(IServicePartitionResolver, IEnumerable<IExceptionHandler>, String)

Initializes a new instance of the CommunicationClientFactoryBase<TCommunicationClient> class.

Properties

ExceptionHandlers

Gets the custom exception handlers for handling exceptions on the client to service communication channel.

ServiceResolver

Gets the ServicePartitionResolver used by the client factory for resolving the service endpoint.

TraceId

Gets the diagnostics trace identifier for this component.

Methods

AbortClient(TCommunicationClient)

Aborts the given client

CreateClientAsync(String, CancellationToken)

Creates a communication client for the given endpoint address.

Dispose()

Dispose the managed/unmanaged resouces. Dispose Method is being added rather than making it IDisposable so that it doesn't change type information and wont be a breaking change.

GetClientAsync(ResolvedServicePartition, TargetReplicaSelector, String, OperationRetrySettings, CancellationToken)

Gets or Creates the CommunicationClient for the specified listener name by resolving based on the given previousRsp.

GetClientAsync(Uri, ServicePartitionKey, TargetReplicaSelector, String, OperationRetrySettings, CancellationToken)

Resolves a partition of the specified service containing one or more communication listeners and returns a client to communicate to the endpoint corresponding to the given listenerName.

The endpoint of the service is of the form - {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}

OpenClient(TCommunicationClient, CancellationToken)

Opens the Communictaion Client

ReportOperationExceptionAsync(TCommunicationClient, ExceptionInformation, OperationRetrySettings, CancellationToken)

Handles the exceptions that occur in the CommunicationClient when sending a message to the Service

ValidateClient(String, TCommunicationClient)

Returns true if the client is still valid and connected to the endpoint specified in the parameter.

ValidateClient(TCommunicationClient)

Returns true if the client is still valid. Connection oriented transports can use this method to indicate that the client is no longer connected to the service.

Events

ClientConnected

Event handler that is fired when the Communication client connects to the service endpoint.

ClientDisconnected

Event handler that is fired when the Communication client disconnects from the service endpoint.

Applies to