public override void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
 {
     foreach (var process in ResolvedDependencies)
     {
         boundedContext.Processes.Add(((IProcess)process));
     }
 }
        public override void Create(BoundedContext boundedContext, IDependencyResolver resolver)
        {
            var aggregateConstructor = resolver.HasService(typeof(IConstructAggregates))
                                           ? (IConstructAggregates)resolver.GetService(typeof(IConstructAggregates))
                                           : null;

            EventStoreAdapter = new GetEventStoreAdapter(m_EventStoreConnection, boundedContext.EventsPublisher, aggregateConstructor);
        }
Exemple #3
0
        public void Create(BoundedContext boundedContext, IDependencyResolver resolver)
        {
            var eventSubscriptions = from pair in m_EventsSubscriptions
                                     group pair by pair.Value
                                     into grouping
                                     select new { endpoint = grouping.Key, types = grouping.Select(g => g.Key) };

            boundedContext.EventsSubscriptions   = eventSubscriptions.ToDictionary(o => o.endpoint, o => o.types);
            boundedContext.CommandsSubscriptions = m_CommandsSubscriptions;
        }
Exemple #4
0
        void IRegistration.Create(CqrsEngine cqrsEngine)
        {
            var boundedContext = new BoundedContext(cqrsEngine, Name, ThreadCount, FailedCommandRetryDelayInternal, m_IsLocal, m_LocalBoundedContext);

            foreach (var descriptor in m_Configurators)
            {
                descriptor.Create(boundedContext, cqrsEngine.DependencyResolver);
            }

            cqrsEngine.BoundedContexts.Add(boundedContext);
        }
 public override void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
 {
     foreach (var handler in ResolvedDependencies)
     {
         IRepository repository = boundedContext.EventStore == null?null:boundedContext.EventStore.Repository;
         boundedContext.CommandDispatcher.Wire(handler,
                                               new OptionalParameter <IEventPublisher>(boundedContext.EventsPublisher),
                                               new OptionalParameter <IRepository>(repository)
                                               );
     }
 }
        public override void Create(BoundedContext boundedContext, IDependencyResolver resolver)
        {
            m_ConstructAggregates = resolver.HasService(typeof(IConstructAggregates))
                ? (IConstructAggregates)resolver.GetService(typeof(IConstructAggregates))
                : null;

            m_ConnectionFactory = resolver.HasService(typeof(IConnectionFactory))
                ? (IConnectionFactory)resolver.GetService(typeof(IConnectionFactory))
                : new ConfigurationConnectionFactory(null);

            IStoreEvents eventStore = m_ConfigureEventStore(new CommitDispatcher(boundedContext.EventsPublisher), m_ConnectionFactory).Build();

            EventStoreAdapter = new NEventStoreAdapter(eventStore, m_ConstructAggregates);
        }
Exemple #7
0
        public override void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
        {
            var lestenedBoundContext = cqrsEngine.BoundedContexts.FirstOrDefault(bc => bc.Name == m_FromBoundContext);

            if (lestenedBoundContext == null)
            {
                throw new ConfigurationErrorsException(string.Format("Bounded context '{0}' not registered", m_FromBoundContext));
            }
            foreach (var projection in ResolvedDependencies)
            {
                //TODO: pass bounded context ReadModel
                lestenedBoundContext.EventDispatcher.Wire(projection);
            }
        }
Exemple #8
0
 public override void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
 {
     boundedContext.CommandDispatcher.Wire(new InfrastructureCommandsHandler(cqrsEngine, boundedContext));
 }
Exemple #9
0
 public virtual void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
 {
 }
Exemple #10
0
 protected virtual void Create(BoundedContext boundedContext)
 {
 }
Exemple #11
0
 public void Create(BoundedContext boundedContext, IDependencyResolver resolver)
 {
     ResolvedDependencies = m_ResolveDependedncies(resolver.GetService);
     Create(boundedContext);
 }
Exemple #12
0
 public void Create(BoundedContext boundedContext, IDependencyResolver resolver)
 {
     boundedContext.CommandRoutes = m_CommandRoutes;
     boundedContext.EventRoutes   = m_EventRoutes;
 }
 public override void Create(BoundedContext boundedContext, IDependencyResolver resolver)
 {
     EventStoreAdapter = (T)resolver.GetService(typeof(T));
 }