Class BowireExtensionRegistry

Namespace
Kuestenlogik.Bowire.Semantics.Extensions
Assembly
Kuestenlogik.Bowire.dll

Discovery + cache for IBowireUiExtension and IBowireFieldDetector instances. Mirrors BowireProtocolRegistry: a single static Discover() sweeps every loaded Kuestenlogik.Bowire* assembly, instantiates the types tagged with BowireExtensionAttribute that implement one of the supported extension interfaces, and exposes them as flat lists.

public sealed class BowireExtensionRegistry
Inheritance
BowireExtensionRegistry
Inherited Members

Remarks

The discovery sweep is intentionally permissive — types whose constructor throws, or assemblies that fail to enumerate, are simply skipped so a single broken extension never takes the whole workbench down. Plugin-load failures show up as a missing extension in the installed list, matching the existing protocol-plugin failure mode.

Both UI extensions and server-side detectors are picked up in the same sweep — a single package can ship a [BowireExtension]-marked detector alongside a [BowireExtension]-marked viewer. Detector discovery is additive to the manual AddSingleton<IBowireFieldDetector, ...>() path: hosts that hand-register a detector continue to work, and the DI wiring in AddBowire(IServiceCollection, Action<BowireOptions>?) suppresses duplicates by concrete type so a built-in that is both marker-tagged AND explicitly registered does not fire twice.

Constructors

BowireExtensionRegistry()

public BowireExtensionRegistry()

Properties

FieldDetectors

All discovered field detectors, registration order preserved. The DI wiring in AddBowire(IServiceCollection, Action<BowireOptions>?) reads this list and registers each entry as an IBowireFieldDetector singleton, additively with any hand-registered detectors already in the container.

public IReadOnlyList<IBowireFieldDetector> FieldDetectors { get; }

Property Value

IReadOnlyList<IBowireFieldDetector>

UiExtensions

All discovered UI extensions, registration order preserved.

public IReadOnlyList<IBowireUiExtension> UiExtensions { get; }

Property Value

IReadOnlyList<IBowireUiExtension>

Methods

Discover()

Scan every loaded Kuestenlogik.Bowire* assembly for extensions and return a fully-built registry. Idempotent — call twice and you get two independent registry instances, each pointing at fresh instances of the discovered descriptor types.

public static BowireExtensionRegistry Discover()

Returns

BowireExtensionRegistry

GetDeclaringAssembly(string)

Resolve the Assembly that contributed the extension (UI extension or field detector) with the given extensionId, or null when no such extension is registered. Used by the asset-serving endpoint to load the embedded bundle out of the right assembly.

public Assembly? GetDeclaringAssembly(string extensionId)

Parameters

extensionId string

Returns

Assembly

GetFieldDetector(string)

Lookup a field detector by id. Returns null when the id is unknown.

public IBowireFieldDetector? GetFieldDetector(string detectorId)

Parameters

detectorId string

Returns

IBowireFieldDetector

GetUiExtension(string)

Lookup a UI extension by id. Returns null when the id is unknown — the asset-serving endpoint maps that to 404 Not Found.

public IBowireUiExtension? GetUiExtension(string extensionId)

Parameters

extensionId string

Returns

IBowireUiExtension