public static HostingComponent Initialize(Configuration configuration,
ContainerComponent containerComponent,
PipelineSettings pipelineSettings)
{
var hostingComponent = new HostingComponent(configuration);
containerComponent.ContainerConfiguration.ConfigureComponent(() => hostingComponent.HostInformation, DependencyLifecycle.SingleInstance);
pipelineSettings.Register("AuditHostInformation", new AuditHostInformationBehavior(hostingComponent.HostInformation, configuration.EndpointName), "Adds audit host information");
pipelineSettings.Register("AddHostInfoHeaders", new AddHostInfoHeadersBehavior(hostingComponent.HostInformation, configuration.EndpointName), "Adds host info headers to outgoing headers");
hostingComponent.AddStartupDiagnosticsSection("Hosting", new
{
hostingComponent.HostInformation.HostId,
HostDisplayName = hostingComponent.HostInformation.DisplayName,
RuntimeEnvironment.MachineName,
OSPlatform = Environment.OSVersion.Platform,
OSVersion = Environment.OSVersion.VersionString,
GCSettings.IsServerGC,
GCLatencyMode = GCSettings.LatencyMode,
Environment.ProcessorCount,
Environment.Is64BitProcess,
CLRVersion = Environment.Version,
Environment.WorkingSet,
Environment.SystemPageSize,
HostName = Dns.GetHostName(),
Environment.UserName,
PathToExe = PathUtilities.SanitizedPath(Environment.CommandLine)
});
return(hostingComponent);
}