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); }
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; }
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); }
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); } }
public override void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine) { boundedContext.CommandDispatcher.Wire(new InfrastructureCommandsHandler(cqrsEngine, boundedContext)); }
public virtual void Process(BoundedContext boundedContext, CqrsEngine cqrsEngine) { }
protected virtual void Create(BoundedContext boundedContext) { }
public void Create(BoundedContext boundedContext, IDependencyResolver resolver) { ResolvedDependencies = m_ResolveDependedncies(resolver.GetService); Create(boundedContext); }
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)); }