Exemple #1
0
        /// <summary>
        /// Builds this <see cref="CqrsEngineHost"/>.
        /// </summary>
        /// <returns>new instance of cloud engine host</returns>
        public CqrsEngineHost Build()
        {
            // nonconditional registrations
            // System presets
            _builder.RegisterType <DispatcherProcess>();
            _builder.RegisterInstance(new MemoryAccount());

            foreach (var module in _moduleEnlistments)
            {
                _builder.RegisterModule(module);
            }
            var container = _builder.Build();
            var system    = new SystemObserver(_observers.ToArray());

            var reg = container.ComponentRegistry;

            Configure(reg, system);

            var processes = container.Resolve <IEnumerable <IEngineProcess> >();
            var scope     = container.Resolve <ILifetimeScope>();
            var host      = new CqrsEngineHost(scope, system, processes);

            host.Initialize();
            return(host);
        }
Exemple #2
0
 public override bool OnStart()
 {
     // this is actually azure initialization;
     _host = BuildHost();
     return(base.OnStart());
 }