public ApplicationEntityManager( IHostApplicationLifetime applicationLifetime, IServiceScopeFactory serviceScopeFactory, IClaraAeChangedNotificationService claraAeChangedNotificationService, IOptions <DicomAdapterConfiguration> configuration, IStorageInfoProvider storageInfoProvider) { _applicationLifetime = applicationLifetime ?? throw new ArgumentNullException(nameof(applicationLifetime)); _serviceScopeFactory = serviceScopeFactory ?? throw new ArgumentNullException(nameof(serviceScopeFactory)); Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _storageInfoProvider = storageInfoProvider ?? throw new ArgumentNullException(nameof(storageInfoProvider)); _serviceScope = serviceScopeFactory.CreateScope(); _serviceProvider = _serviceScope.ServiceProvider; _loggerFactory = _serviceProvider.GetService <ILoggerFactory>(); _logger = _loggerFactory.CreateLogger <ApplicationEntityManager>(); _unsubscriberForClaraAeChangedNotificationService = claraAeChangedNotificationService.Subscribe(this); _associationCounter = uint.MaxValue; _aeTitleManagers = new ConcurrentDictionary <string, Lazy <ApplicationEntityHandler> >(); _cancellationTokenSource = new CancellationTokenSource(); _applicationLifetime.ApplicationStopping.Register(OnApplicationStopping); InitializeClaraAeTitles(); }
public ClaraAeTitleController( IServiceProvider serviceProvider, ILogger <ClaraAeTitleController> logger, ConfigurationValidator configurationValidator, IOptions <DicomAdapterConfiguration> dicomAdapterConfiguration, IClaraAeChangedNotificationService claraAeChangedNotificationService, IDicomAdapterRepository <ClaraApplicationEntity> dicomAdapterRepository) { _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _dicomAdapterRepository = dicomAdapterRepository ?? throw new ArgumentNullException(nameof(dicomAdapterRepository)); _configurationValidator = configurationValidator ?? throw new ArgumentNullException(nameof(configurationValidator)); _dicomAdapterConfiguration = dicomAdapterConfiguration ?? throw new ArgumentNullException(nameof(dicomAdapterConfiguration)); _claraAeChangedNotificationService = claraAeChangedNotificationService ?? throw new ArgumentNullException(nameof(claraAeChangedNotificationService)); }