コード例 #1
0
 public override void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
 {
     foreach (var process in ResolvedDependencies)
     {
         boundedContext.Processes.Add(((IProcess)process));
     }
 }
コード例 #2
0
        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);
        }
コード例 #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;
        }
コード例 #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);
        }
コード例 #5
0
 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)
                                               );
     }
 }
コード例 #6
0
        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);
        }
コード例 #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);
            }
        }
コード例 #8
0
 public override void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
 {
     boundedContext.CommandDispatcher.Wire(new InfrastructureCommandsHandler(cqrsEngine, boundedContext));
 }
コード例 #9
0
 public virtual void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine)
 {
 }
コード例 #10
0
 protected virtual void Create(BoundedContext boundedContext)
 {
 }
コード例 #11
0
 public void Create(BoundedContext boundedContext, IDependencyResolver resolver)
 {
     ResolvedDependencies = m_ResolveDependedncies(resolver.GetService);
     Create(boundedContext);
 }
コード例 #12
0
 public void Create(BoundedContext boundedContext, IDependencyResolver resolver)
 {
     boundedContext.CommandRoutes = m_CommandRoutes;
     boundedContext.EventRoutes   = m_EventRoutes;
 }
コード例 #13
0
 public override void Create(BoundedContext boundedContext, IDependencyResolver resolver)
 {
     EventStoreAdapter = (T)resolver.GetService(typeof(T));
 }