public UtilityProvider(DIContainer container, IConfigService configService, IMessageProvider messageProvider) { this.container = container; this.debug = new Lazy <IDebug>(() => DebugFactory.Create(configService), LazyThreadSafetyMode.ExecutionAndPublication); this.instrumentation = new Lazy <IInstrumentation>(() => InstrumentationFactory.Create(configService), LazyThreadSafetyMode.ExecutionAndPublication); this.compression = new Lazy <ICompression>(() => new Compression.Compression(), LazyThreadSafetyMode.ExecutionAndPublication); this.logger = new Lazy <ILogger>(() => LoggerFactory.Create(configService, messageProvider), LazyThreadSafetyMode.ExecutionAndPublication); this.safeBlockProvider = new Lazy <ISafeBlockProvider>(() => new SafeBlockProvider(configService, this.logger.Value), LazyThreadSafetyMode.ExecutionAndPublication); this.defaultSerializer = new Lazy <Serializer>(() => Serializer.Binary, LazyThreadSafetyMode.ExecutionAndPublication); this.printService = new Lazy <IPrintService>(() => PrintServiceFactory.Create(configService, this.logger.Value), LazyThreadSafetyMode.ExecutionAndPublication); this.threadProvider = new Lazy <IThreadPoolFactory>(() => new ThreadPoolFactory(configService), LazyThreadSafetyMode.ExecutionAndPublication); }
private static void LoadDebug(IDIContainer container, IConfigService configService) { var debug = DebugFactory.Create(configService); container.RegistryInstance <IDebug>(debug); }