Table of Contents

Class JsonRpcDescriptor<T>

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

A descriptor that captures the primary service shape and generated proxy support.

public abstract record JsonRpcDescriptor<T> : JsonRpcDescriptor, IEquatable<JsonRpcDescriptor>, IJsonRpcDescriptor<T>, IJsonRpcDescriptor, IEquatable<JsonRpcDescriptor<T>> where T : class

Type Parameters

T

The primary service interface.

Inheritance
JsonRpcDescriptor<T>
Implements
Derived
Inherited Members

Constructors

JsonRpcDescriptor(ServiceMoniker, ITypeShape<T>)

Initializes a new instance of the JsonRpcDescriptor<T> class.

protected JsonRpcDescriptor(ServiceMoniker moniker, ITypeShape<T> shape)

Parameters

moniker ServiceMoniker

The service identity.

shape ITypeShape<T>

The generated primary interface shape.

Methods

AddRpcTarget(JsonRpc, T, IReadOnlyList<ServiceInterface>)

Registers the typed service implementation and its supported optional contracts.

public virtual void AddRpcTarget(JsonRpc connection, T target, IReadOnlyList<ServiceInterface> additionalInterfaces)

Parameters

connection JsonRpc

The unstarted connection.

target T

The service implementation.

additionalInterfaces IReadOnlyList<ServiceInterface>

The supported optional interfaces.

AddRpcTargetCore(JsonRpc, object, IReadOnlyList<ServiceInterface>)

Registers a service after its type has been erased for catalog storage.

protected override sealed void AddRpcTargetCore(JsonRpc connection, object target, IReadOnlyList<ServiceInterface> additionalInterfaces)

Parameters

connection JsonRpc

The unstarted connection.

target object

The service implementation.

additionalInterfaces IReadOnlyList<ServiceInterface>

The supported optional contracts.

CreateLocalProxy(ServiceProxyContext, IReadOnlyList<ServiceInterface>)

Constructs a direct, generated service proxy with explicit ownership.

public virtual T CreateLocalProxy(ServiceProxyContext context, IReadOnlyList<ServiceInterface> additionalInterfaces)

Parameters

context ServiceProxyContext

The context that supplies a leased target and boundary policy.

additionalInterfaces IReadOnlyList<ServiceInterface>

The supported additional interfaces.

Returns

T

The generated forwarding proxy.

CreateLocalTarget(ServiceProxyContext, IReadOnlyList<ServiceInterface>)

Constructs a typed server-side forwarding target for asynchronous activation.

public virtual T CreateLocalTarget(ServiceProxyContext context, IReadOnlyList<ServiceInterface> additionalInterfaces)

Parameters

context ServiceProxyContext

The activation and lifetime context.

additionalInterfaces IReadOnlyList<ServiceInterface>

The supported optional interfaces.

Returns

T

The generated server target.

CreateLocalTargetCore(ServiceProxyContext, IReadOnlyList<ServiceInterface>)

Constructs a forwarding target after its contract type has been erased.

protected override sealed object CreateLocalTargetCore(ServiceProxyContext context, IReadOnlyList<ServiceInterface> additionalInterfaces)

Parameters

context ServiceProxyContext

The activation context.

additionalInterfaces IReadOnlyList<ServiceInterface>

The supported optional contracts.

Returns

object

The forwarding target.

CreateProxy(JsonRpc, IReadOnlyList<ServiceInterface>, ServiceActivationOptions)

Constructs an RPC proxy before its connection is started.

public virtual T CreateProxy(JsonRpc connection, IReadOnlyList<ServiceInterface> additionalInterfaces, ServiceActivationOptions options = default)

Parameters

connection JsonRpc

The connection owned by the proxy.

additionalInterfaces IReadOnlyList<ServiceInterface>

The supported additional interfaces.

options ServiceActivationOptions

Activation options, including a callback target.

Returns

T

The generated service proxy.