Esempio n. 1
0
        private void StartServices(IServiceProvider serviceProvider)
        {
            SystemService systemService = serviceProvider.GetRequiredService <SystemService>();

            systemService.Start();

            serviceProvider.GetRequiredService <StorageService>().Start();
            serviceProvider.GetRequiredService <DiagnosticsService>().Start();
            serviceProvider.GetRequiredService <MessageBusService>().Start();

            serviceProvider.GetRequiredService <ResourceService>().Start();
            serviceProvider.GetRequiredService <GlobalVariablesService>().Start();
            serviceProvider.GetRequiredService <CloudService>().Start();

            serviceProvider.GetRequiredService <SchedulerService>().Start();

            // Start hardware related services.
            serviceProvider.GetRequiredService <GpioRegistryService>().Start();
            serviceProvider.GetRequiredService <I2CBusService>().Start();
            serviceProvider.GetRequiredService <MqttService>().Start();
            serviceProvider.GetRequiredService <HttpServerService>().Start();
            serviceProvider.GetRequiredService <DiscoveryService>().Start();

            serviceProvider.GetRequiredService <PythonEngineService>().Start();

            StartupScriptsService startupScriptsService = serviceProvider.GetRequiredService <StartupScriptsService>();

            startupScriptsService.Start();

            serviceProvider.GetRequiredService <FunctionPoolService>().Start();
            serviceProvider.GetRequiredService <ServiceHostService>().Start();

            serviceProvider.GetRequiredService <NotificationsService>().Start();

            serviceProvider.GetRequiredService <HistoryService>().Start();

            systemService.OnServicesInitialized();

            // Start data related services.
            serviceProvider.GetRequiredService <ComponentGroupRegistryService>().Start();
            serviceProvider.GetRequiredService <ComponentRegistryService>().Start();
            serviceProvider.GetRequiredService <MacroRegistryService>().Start();

            systemService.OnConfigurationLoaded();

            systemService.OnStartupCompleted();
        }
 public StartupScriptsController(StartupScriptsService startupScriptsService)
 {
     _startupScriptsService = startupScriptsService ?? throw new ArgumentNullException(nameof(startupScriptsService));
 }