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