public void Build(BuildContext context, IVostokHostingEnvironment environment) { this.environment = environment; if (context.ZooKeeperClient != null && !(context.ZooKeeperClient is DevNullZooKeeperClient)) { HostExtensions.Add(context.ZooKeeperClient); } if (!(context.ServiceDiscoveryEventsContext is DevNullServiceDiscoveryEventsContext)) { HostExtensions.Add(context.ServiceDiscoveryEventsContext); } HostExtensions.Add <IVostokApplicationDiagnostics>(context.DiagnosticsHub); HostExtensions.Add(context.Logs.LogEventLevelCounterFactory); HostExtensions.Add <IConfigurationSource>("MergedConfigurationSource", context.MergedConfigurationSource); builderCustomization.Customize(this); context.HostExtensions = HostExtensions; // note (kungurtsev, 02.11.2021): user components should be disposed right after application in reverse order disposables.Reverse(); context.Disposables.InsertRange(0, disposables); }
public void Build(BuildContext context, IVostokHostingEnvironment environment) { this.environment = environment; if (context.ZooKeeperClient != null && !(context.ZooKeeperClient is DevNullZooKeeperClient)) { HostExtensions.Add(context.ZooKeeperClient); } HostExtensions.Add <IVostokApplicationDiagnostics>(context.DiagnosticsHub); HostExtensions.Add(context.Logs.LogEventLevelCounterFactory); builderCustomization.Customize(this); context.DisposableHostExtensions = disposable; context.HostExtensions = HostExtensions; }
public void Build(BuildContext context, IVostokHostingEnvironment environment) { this.environment = environment; if (context.ZooKeeperClient != null && !(context.ZooKeeperClient is DevNullZooKeeperClient)) { HostExtensions.Add(context.ZooKeeperClient); } builderCustomization.Customize(this); context.DisposableHostExtensions = disposable; }