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
TThe 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
monikerServiceMonikerThe service identity.
shapeITypeShape<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
connectionJsonRpcThe unstarted connection.
targetTThe service implementation.
additionalInterfacesIReadOnlyList<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
connectionJsonRpcThe unstarted connection.
targetobjectThe service implementation.
additionalInterfacesIReadOnlyList<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
contextServiceProxyContextThe context that supplies a leased target and boundary policy.
additionalInterfacesIReadOnlyList<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
contextServiceProxyContextThe activation and lifetime context.
additionalInterfacesIReadOnlyList<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
contextServiceProxyContextThe activation context.
additionalInterfacesIReadOnlyList<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
connectionJsonRpcThe connection owned by the proxy.
additionalInterfacesIReadOnlyList<ServiceInterface>The supported additional interfaces.
optionsServiceActivationOptionsActivation options, including a callback target.
Returns
- T
The generated service proxy.