Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        private static void LoadInstrumentation(IDIContainer container, IConfigService configService)
        {
            var instrumentation = InstrumentationFactory.Create(configService);

            container.RegistryInstance <IInstrumentation>(instrumentation);
        }