public void Start() { DbProviderFactories.RegisterFactory("System.Data.SqlClient", SqlClientFactory.Instance); Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed("Shuttle.Abacus"); EventStore.Register(container); ServiceBus.Register(container); container.Register <ArgumentHandler>(); container.Register <FormulaHandler>(); container.Register <MatrixHandler>(); container.Register <TestHandler>(); _eventProcessor = container.Resolve <IEventProcessor>(); _eventProcessor.AddProjection(new Projection("Argument").AddEventHandler(container.Resolve <ArgumentHandler>())); _eventProcessor.AddProjection(new Projection("Formula").AddEventHandler(container.Resolve <FormulaHandler>())); _eventProcessor.AddProjection(new Projection("Matrix").AddEventHandler(container.Resolve <MatrixHandler>())); _eventProcessor.AddProjection(new Projection("Test").AddEventHandler(container.Resolve <TestHandler>())); container.Resolve <IDatabaseContextFactory>().ConfigureWith("Abacus"); _bus = ServiceBus.Create(container).Start(); _eventProcessor.Start(); }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed("Shuttle.Access.Sql"); EventStore.Register(container); _eventStore = EventStore.Create(container); container.Register <UserHandler>(); container.Register <RoleHandler>(); _eventProcessor = container.Resolve <IEventProcessor>(); _eventProcessor.AddProjection( new Recall.Projection("SystemUsers").AddEventHandler(container.Resolve <UserHandler>())); _eventProcessor.AddProjection( new Recall.Projection("SystemRoles").AddEventHandler(container.Resolve <RoleHandler>())); _eventProcessor.Start(); }