Ejemplo n.º 1
0
        public void Configure(IComponentRegistry componentRegistry)
        {
            var builder = new ContainerBuilder();

            if (_atomicStorageFactory == null)
            {
                AtomicIsInMemory(strategyBuilder => { });
            }
            if (_streamingRoot == null)
            {
                StreamingIsInFiles(Directory.GetCurrentDirectory());
            }
            if (_tapeStorage == null)
            {
                TapeIsInMemory();
            }

            var core   = new AtomicRegistrationCore(_atomicStorageFactory);
            var source = new AtomicRegistrationSource(core);

            builder.RegisterSource(source);
            builder.RegisterInstance(new NuclearStorage(_atomicStorageFactory));
            builder
            .Register(
                c => new AtomicStorageInitialization(new[] { _atomicStorageFactory }, c.Resolve <ISystemObserver>()))
            .As <IEngineProcess>().SingleInstance();

            builder.RegisterInstance(_streamingRoot);

            builder.RegisterInstance(_tapeStorage);
            builder.RegisterInstance(new TapeStorageInitilization(new[] { _tapeStorage })).As <IEngineProcess>();

            builder.Update(componentRegistry);
        }
Ejemplo n.º 2
0
        public void Configure(IComponentRegistry componentRegistry)
        {
            var builder = new ContainerBuilder();

            if (_atomicStorageFactory == null)
            {
                AtomicIsInMemory(strategyBuilder => { });
            }
            if (_streamingRoot == null)
            {
                StreamingIsInFiles(Directory.GetCurrentDirectory());
            }
            if (_tapeStorage == null)
            {
                TapeIsInMemory();
            }

            var core = new AtomicRegistrationCore(_atomicStorageFactory);
            var source = new AtomicRegistrationSource(core);
            builder.RegisterSource(source);
            builder.RegisterInstance(new NuclearStorage(_atomicStorageFactory));
            builder
                .Register(
                    c => new AtomicStorageInitialization(new[] {_atomicStorageFactory}, c.Resolve<ISystemObserver>()))
                .As<IEngineProcess>().SingleInstance();

            builder.RegisterInstance(_streamingRoot);

            builder.RegisterInstance(_tapeStorage);
            builder.RegisterInstance(new TapeStorageInitilization(new[] {_tapeStorage})).As<IEngineProcess>();

            builder.Update(componentRegistry);
        }