Table of Contents

Class ServiceRegistration

Namespace
Nerdbank.JsonRpc.BrokeredServices
Assembly
Nerdbank.JsonRpc.dll

Declares a service identity, exposure policy, supported optional contracts, and optional loader.

public sealed class ServiceRegistration
Inheritance
ServiceRegistration
Inherited Members

Constructors

ServiceRegistration(ServiceMoniker, BrokeredServiceLoader?, ServiceAudience, IReadOnlyList<string>?)

Initializes a new instance of the ServiceRegistration class.

public ServiceRegistration(ServiceMoniker moniker, BrokeredServiceLoader? loadAsync = null, ServiceAudience audience = ServiceAudience.Local, IReadOnlyList<string>? additionalInterfaceIds = null)

Parameters

moniker ServiceMoniker

The service identity.

loadAsync BrokeredServiceLoader

Loads the implementation and proffers its factory, or null for externally proffered services.

audience ServiceAudience

The permitted clients, defaulting to same-machine access.

additionalInterfaceIds IReadOnlyList<string>

The stable wire identifiers of optional contracts supported by every activation of this registration.

Remarks

Identifiers are case-sensitive and resolved against the proffered server descriptor. No contract types or shapes are required at registration time.

Properties

AdditionalInterfaceIds

Gets the supported optional contracts' stable wire identifiers, independently of contract assemblies.

public IReadOnlyList<string> AdditionalInterfaceIds { get; }

Property Value

IReadOnlyList<string>

Remarks

These ordinal, case-sensitive strings match Id and the capability identifiers sent to clients.

Audience

Gets the permitted clients, enforced before implementation loading.

public ServiceAudience Audience { get; }

Property Value

ServiceAudience

LoadAsync

Gets the optional callback that loads implementation code and proffers a factory.

public BrokeredServiceLoader? LoadAsync { get; }

Property Value

BrokeredServiceLoader

Remarks

The callback runs at most once per registration, including failed attempts. Removing and re-registering creates a new loading lifetime.

Moniker

Gets the service identity, independent of any implementation or contract assembly.

public ServiceMoniker Moniker { get; }

Property Value

ServiceMoniker