예제 #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);
        }
예제 #2
0
 public LoadResources(string resourceDirectory, IWriter writer, IDirectory directory, IResourceCatalogFactory resourceCatalogFactory)
 {
     _writer                 = writer;
     _directory              = directory;
     _resourceDirectory      = resourceDirectory;
     _resourceCatalogFactory = resourceCatalogFactory;
     _catalog                = resourceCatalogFactory.New();
 }