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
monikerServiceMonikerThe service identity.
loadAsyncBrokeredServiceLoaderLoads the implementation and proffers its factory, or null for externally proffered services.
audienceServiceAudienceThe permitted clients, defaulting to same-machine access.
additionalInterfaceIdsIReadOnlyList<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
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
LoadAsync
Gets the optional callback that loads implementation code and proffers a factory.
public BrokeredServiceLoader? LoadAsync { get; }
Property Value
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; }