Interface ITransportRegistry
Registry for managing transport adapters and their configurations.
public interface ITransportRegistry
- Extension Methods
Remarks
Transport packages use this interface to register their adapters during DI composition. Runtime code uses it to look up adapters by name.
The default implementation is registered as a singleton via GetOrCreateTransportRegistry(IServiceCollection).
Properties
DefaultTransportName
Gets the name of the default transport.
string? DefaultTransportName { get; }
Property Value
HasDefaultTransport
Gets a value indicating whether a default transport has been configured.
bool HasDefaultTransport { get; }
Property Value
HasRemoteTransport
Gets a value indicating whether any registered transport — initialized or a pending factory — delivers across a network boundary (Remote).
bool HasRemoteTransport { get; }
Property Value
Methods
GetTransportAdapter(string)
Gets a transport adapter by name.
ITransportAdapter? GetTransportAdapter(string name)
Parameters
namestringThe transport name.
Returns
- ITransportAdapter
The transport adapter, or null if not found.
GetTransportNames()
Gets all registered transport names, including pending factories.
IEnumerable<string> GetTransportNames()
Returns
- IEnumerable<string>
Collection of transport names (both initialized and pending).
RegisterTransport(string, ITransportAdapter, string, TransportLocality, Dictionary<string, object>?)
Registers a transport adapter.
void RegisterTransport(string name, ITransportAdapter adapter, string transportType, TransportLocality locality, Dictionary<string, object>? options = null)
Parameters
namestringThe transport name.
adapterITransportAdapterThe transport adapter.
transportTypestringThe transport type identifier.
localityTransportLocalityWhether the transport delivers in-process (Local) or across a network boundary (Remote).
optionsDictionary<string, object>Optional transport options.
RegisterTransportFactory(string, string, TransportLocality, Func<IServiceProvider, ITransportAdapter>)
Registers a transport adapter factory for deferred creation.
void RegisterTransportFactory(string name, string transportType, TransportLocality locality, Func<IServiceProvider, ITransportAdapter> factory)
Parameters
namestringThe transport name.
transportTypestringThe transport type identifier.
localityTransportLocalityWhether the transport delivers in-process (Local) or across a network boundary (Remote).
factoryFunc<IServiceProvider, ITransportAdapter>Factory function to create the adapter at runtime.
SetDefaultTransport(string)
Sets the default transport by name.
void SetDefaultTransport(string name)
Parameters
namestringThe name of the transport to set as default.
Exceptions
- InvalidOperationException
Thrown when the specified transport is not registered.