Interface IJsonRpcDescriptor
- Namespace
- Nerdbank.JsonRpc.BrokeredServices
- Assembly
- Nerdbank.JsonRpc.dll
Describes a service's wire contract and constructs its server connection.
public interface IJsonRpcDescriptor
Remarks
Implementations must expose only the declared contract, not arbitrary implementation methods.
Properties
AdditionalInterfaces
Gets known additional contracts and their generated shapes, not implementation capabilities.
IReadOnlyList<ServiceInterface> AdditionalInterfaces { get; }
Property Value
Moniker
Gets the identity of the service.
ServiceMoniker Moniker { get; }
Property Value
RpcOptions
Gets connection policies, including direct-call exception disclosure.
JsonRpcOptions RpcOptions { get; }
Property Value
Methods
AddRpcTargetCore(JsonRpc, object, IReadOnlyList<ServiceInterface>)
Registers the primary service contract and explicitly registered additional interfaces.
void AddRpcTargetCore(JsonRpc connection, object target, IReadOnlyList<ServiceInterface> additionalInterfaces)
Parameters
connectionJsonRpcThe unstarted connection.
targetobjectThe service implementation.
additionalInterfacesIReadOnlyList<ServiceInterface>The interfaces supported by this registration.
Remarks
This type-erased infrastructure entry point is for catalog dispatch. Use the typed descriptor's AddRpcTarget method when the contract type is known.
CreateCallbackProxy(JsonRpc)
Constructs the client's callback proxy on an unstarted server connection.
object? CreateCallbackProxy(JsonRpc connection)
Parameters
connectionJsonRpcThe server connection.
Returns
- object
The callback proxy, or null if the service has no callback contract.
CreateConnection(IDuplexPipe, ServiceRpcContext?)
Constructs an unstarted connection. Successful construction transfers pipe ownership.
JsonRpc CreateConnection(IDuplexPipe pipe, ServiceRpcContext? context = null)
Parameters
pipeIDuplexPipeThe connected transport.
contextServiceRpcContextRuntime infrastructure for this connection.
Returns
- JsonRpc
The connection, whose owner must dispose it.
Remarks
Implementations that initialize a transport wrapper may transfer ownership before construction completes, including on failure.
CreateLocalCallback(object, ILogger<ServiceProxyContext>?)
Constructs a direct callback boundary without owning the caller's target.
object CreateLocalCallback(object target, ILogger<ServiceProxyContext>? logger = null)
Parameters
targetobjectThe caller-owned callback implementation.
loggerILogger<ServiceProxyContext>The direct callback logger.
Returns
- object
The generated, activation-owned callback boundary.
CreateLocalTarget(ServiceProxyContext, IReadOnlyList<ServiceInterface>)
Constructs a generated server-side forwarding target for asynchronous activation.
object CreateLocalTarget(ServiceProxyContext context, IReadOnlyList<ServiceInterface> additionalInterfaces)
Parameters
contextServiceProxyContextThe activation and lifetime context.
additionalInterfacesIReadOnlyList<ServiceInterface>The registration's supported interfaces.
Returns
- object
The generated server target.