Beispiel #1
0
        public ServerLifecycleManager(StartupConfiguration startupConfiguration)
        {
            SetApplicationDirectory();
            _writer = startupConfiguration.Writer;
            _serverEnvironmentPreparer     = startupConfiguration.ServerEnvironmentPreparer;
            _startUpDirectory              = startupConfiguration.Directory;
            _startupResourceCatalogFactory = startupConfiguration.ResourceCatalogFactory;
            _ipcClient      = startupConfiguration.IpcClient;
            _assemblyLoader = startupConfiguration.AssemblyLoader;
            _pulseLogger    = new PulseLogger(60000).Start();
            _pulseTracker   = new PulseTracker(TimeSpan.FromDays(1).TotalMilliseconds).Start();
            _serverEnvironmentPreparer.PrepareEnvironment();
            _startWebServer         = startupConfiguration.StartWebServer;
            _webServerConfiguration = startupConfiguration.WebServerConfiguration;

            _loggingProcessMonitor = startupConfiguration.LoggingServiceMonitor;
            _loggingProcessMonitor.OnProcessDied += (e) => _writer.WriteLine("logging service exited");

            _queueProcessMonitor = startupConfiguration.QueueWorkerMonitor;
            _queueProcessMonitor.OnProcessDied += (config) => _writer.WriteLine($"queue process died: {config.Name}({config.Id})");

            _webSocketPool = startupConfiguration.WebSocketPool;

            SecurityIdentityFactory.Set(startupConfiguration.SecurityIdentityFactory);
        }
 public static void InitializeTests(TestContext testContext)
 {
     try
     {
         SecurityIdentityFactory.Get();
     }
     catch (Exception e)
     {
         Assert.AreEqual("security identity factory not set", e.Message);
     }
     try
     {
         SecurityIdentityFactory.Set(new SecurityIdentityFactoryForWindows());
     }
     catch (Exception e2)
     {
         Assert.AreEqual("security identity factory already set", e2.Message);
     }
 }