9cff87fe85
Remove project bookkeeping citations from shipped code comments across the solution: hyphenated task IDs (WP-14, StoreAndForward-025), milestone/task/ issue refs (M3, Task 4, Audit Log #23, #21), Bundle X task-bundle labels, and C/D/K/S/T phase labels. Comment text only — no code logic, string/log literals, or XML-doc structure changed. Genuine descriptions are preserved (only the citation is stripped), and technical lookalikes are retained (UTF-8, SHA-256, T00:00:00, M365, UTC-5, pre-C4/pre-C5 schema versions). Flagged by the new CommentChecker TaskReferenceInComment / TrackingReferenceInComment checks plus targeted grep passes; full solution builds clean, append-only guard tests pass.
48 lines
2.4 KiB
C#
48 lines
2.4 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.ClusterInfrastructure;
|
|
|
|
/// <summary>
|
|
/// DI registration for the Cluster Infrastructure component.
|
|
/// </summary>
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// Registers the Cluster Infrastructure services. This component owns the
|
|
/// cluster <em>configuration contract</em> (<see cref="ClusterOptions"/>); the
|
|
/// Akka.NET bootstrap itself lives in <c>ZB.MOM.WW.ScadaBridge.Host</c>
|
|
/// (see <c>Component-ClusterInfrastructure.md</c>).
|
|
/// <para>
|
|
/// Registering the <see cref="ClusterOptionsValidator"/> means a misconfigured
|
|
/// <c>ScadaBridge:Cluster</c> section (e.g. <c>MinNrOfMembers: 2</c> or a quorum
|
|
/// split-brain strategy) throws an <see cref="OptionsValidationException"/> the
|
|
/// first time <see cref="IOptions{TOptions}"/> is resolved, rather than booting
|
|
/// into a broken cluster.
|
|
/// </para>
|
|
/// </summary>
|
|
/// <param name="services">The service collection to register into.</param>
|
|
/// <returns>The same <paramref name="services"/> instance, for call chaining.</returns>
|
|
public static IServiceCollection AddClusterInfrastructure(this IServiceCollection services)
|
|
{
|
|
services.TryAddEnumerable(
|
|
ServiceDescriptor.Singleton<IValidateOptions<ClusterOptions>, ClusterOptionsValidator>());
|
|
return services;
|
|
}
|
|
|
|
// The previous `AddClusterInfrastructureActors` extension
|
|
// was dead surface — its XML doc told callers "do not call", its body
|
|
// unconditionally threw `NotImplementedException`, and no production caller
|
|
// existed anywhere in the solution (verified by grep). The
|
|
// "throw loudly" decision was made while the ownership question was
|
|
// still open; that question is now permanently settled by the
|
|
// "Implementation Note — Code Placement" section of
|
|
// Component-ClusterInfrastructure.md, which records that all actor wiring
|
|
// lives in ZB.MOM.WW.ScadaBridge.Host (AkkaHostedService). Keeping a public extension
|
|
// method that exists only to throw was API-surface noise that an IDE would
|
|
// still suggest via auto-complete, so the method and its companion
|
|
// `AddClusterInfrastructureActors_ThrowsRatherThanSilentlySucceeding` test
|
|
// were both removed.
|
|
}
|