public PortfolioStorage( IAggregateStorage aggregateStorage, IBlobStorage blobStorage) { _aggregateStorage = aggregateStorage; _blobStorage = blobStorage; }
public CreateResearchCaseUseCase( IAggregateStorage <ResearchCase> researchCaseStorage, ILogger <CreateResearchCaseUseCase> logger) { _researchCaseStorage = researchCaseStorage; _logger = logger; }
public DefaultEventService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher<DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { _eventMailboxDict = new ConcurrentDictionary<string, EventMailBox>(); _ioHelper = ioHelper; _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); _batchSize = ENodeConfiguration.Instance.Setting.EventMailBoxPersistenceMaxBatchSize; }
public DefaultEventCommittingService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher <DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { _eventCommittingContextMailBoxList = new List <EventCommittingContextMailBox>(); _ioHelper = ioHelper; _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); _eventMailboxCount = ENodeConfiguration.Instance.Setting.EventMailBoxCount; _batchSize = ENodeConfiguration.Instance.Setting.EventMailBoxPersistenceMaxBatchSize; _timeoutSeconds = ENodeConfiguration.Instance.Setting.AggregateRootMaxInactiveSeconds; _taskName = "CleanInactiveAggregates_" + DateTime.Now.Ticks + new Random().Next(10000); for (var i = 0; i < _eventMailboxCount; i++) { _eventCommittingContextMailBoxList.Add(new EventCommittingContextMailBox(i, _batchSize, BatchPersistEventCommittingContexts, _logger)); } }
public DefaultEventCommittingService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher <DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { _eventCommittingContextMailBoxList = new List <EventCommittingContextMailBox>(); _ioHelper = ioHelper; _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); _eventMailboxCount = ENodeConfiguration.Instance.Setting.EventMailBoxCount; _batchSize = ENodeConfiguration.Instance.Setting.EventMailBoxPersistenceMaxBatchSize; for (var i = 0; i < _eventMailboxCount; i++) { _eventCommittingContextMailBoxList.Add(new EventCommittingContextMailBox(i, _batchSize, x => BatchPersistEventAsync(x, 0), _logger)); } }
/// <summary>Parameterized constructor. /// </summary> /// <param name="waitingCommandService"></param> /// <param name="aggregateRootTypeCodeProvider"></param> /// <param name="aggregateRootFactory"></param> /// <param name="eventStreamConvertService"></param> /// <param name="eventSourcingService"></param> /// <param name="memoryCache"></param> /// <param name="aggregateStorage"></param> /// <param name="retryCommandService"></param> /// <param name="eventStore"></param> /// <param name="eventPublisher"></param> /// <param name="actionExecutionService"></param> /// <param name="eventSynchronizerProvider"></param> /// <param name="loggerFactory"></param> public DefaultCommitEventService( IWaitingCommandService waitingCommandService, IAggregateRootTypeCodeProvider aggregateRootTypeCodeProvider, IAggregateRootFactory aggregateRootFactory, IEventStreamConvertService eventStreamConvertService, IEventSourcingService eventSourcingService, IMemoryCache memoryCache, IAggregateStorage aggregateStorage, IRetryCommandService retryCommandService, IEventStore eventStore, IEventPublisher eventPublisher, IActionExecutionService actionExecutionService, IEventSynchronizerProvider eventSynchronizerProvider, ILoggerFactory loggerFactory) { _waitingCommandService = waitingCommandService; _aggregateRootTypeCodeProvider = aggregateRootTypeCodeProvider; _aggregateRootFactory = aggregateRootFactory; _eventStreamConvertService = eventStreamConvertService; _eventSourcingService = eventSourcingService; _memoryCache = memoryCache; _aggregateStorage = aggregateStorage; _retryCommandService = retryCommandService; _eventStore = eventStore; _eventPublisher = eventPublisher; _actionExecutionService = actionExecutionService; _eventSynchronizerProvider = eventSynchronizerProvider; _logger = loggerFactory.Create(GetType().Name); }
public DefaultMemoryCache(ITypeNameProvider typeNameProvider, IAggregateStorage aggregateStorage, ILoggerFactory loggerFactory) { _aggregateRootInfoDict = new ConcurrentDictionary <string, AggregateCacheInfo>(); _typeNameProvider = typeNameProvider; _aggregateStorage = aggregateStorage; _logger = loggerFactory.Create(GetType().FullName); }
public DefaultEventService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher <DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { _mailboxDict = new ConcurrentDictionary <string, EventMailBox>(); _ioHelper = ioHelper; _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); _batchSize = ENodeConfiguration.Instance.Setting.EventMailBoxPersistenceMaxBatchSize; _timeoutSeconds = ENodeConfiguration.Instance.Setting.AggregateRootMaxInactiveSeconds; _taskName = "CleanInactiveAggregates_" + DateTime.Now.Ticks + new Random().Next(10000); }
public CreateJusticeCaseUseCase( IAggregateStorage <JusticeCase> justiceCaseStorage, ILogger <CreateJusticeCaseUseCase> logger) { _justiceCaseStorage = justiceCaseStorage; _logger = logger; }
public DefaultMemoryCache(ITypeCodeProvider aggregateRootTypeCodeProvider, IAggregateStorage aggregateStorage, IScheduleService scheduleService, ILoggerFactory loggerFactory) { _aggregateRootTypeCodeProvider = aggregateRootTypeCodeProvider; _aggregateStorage = aggregateStorage; _scheduleService = scheduleService; _logger = loggerFactory.Create(GetType().FullName); TimeoutSeconds = ENodeConfiguration.Instance.Setting.AggregateRootMaxInactiveSeconds; _scheduleService.StartTask("RemoveExpiredAggregates", RemoveExpiredAggregates, 1000, ENodeConfiguration.Instance.Setting.ScanExpiredAggregateIntervalMilliseconds); }
public CommandExecuteContext(IRepository repository, IAggregateStorage aggregateRootStorage, CommandMessage commandMessage, SendReplyService sendReplyService, IMessageTransportationContext messageContext, ILogger logger) { _trackingAggregateRootDict = new ConcurrentDictionary <string, IAggregateRoot>(); _repository = repository; _aggregateRootStorage = aggregateRootStorage; _sendReplyService = sendReplyService; _messageContext = messageContext; _commandMessage = commandMessage; _logger = logger; }
public DefaultMemoryCache(IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IAggregateStorage aggregateStorage, ILoggerFactory loggerFactory) { _scheduleService = scheduleService; _aggregateRootInfoDict = new ConcurrentDictionary <string, AggregateCacheInfo>(); _typeNameProvider = typeNameProvider; _aggregateStorage = aggregateStorage; _logger = loggerFactory.Create(GetType().FullName); _timeoutSeconds = ENodeConfiguration.Instance.Setting.AggregateRootMaxInactiveSeconds; _taskName = "CleanInactiveAggregates_" + DateTime.Now.Ticks + new Random().Next(10000); }
public CommandExecuteContext(IRepository repository, IAggregateStorage aggregateRootStorage, QueueMessage queueMessage, IMessageContext messageContext, CommandMessage commandMessage, SendReplyService sendReplyService) { _trackingAggregateRootDict = new ConcurrentDictionary <string, IAggregateRoot>(); _repository = repository; _aggregateRootStorage = aggregateRootStorage; _sendReplyService = sendReplyService; _queueMessage = queueMessage; _commandMessage = commandMessage; _messageContext = messageContext; }
public CommandConsumer(string groupName = null, ConsumerSetting setting = null) { _consumer = new Consumer(groupName ?? DefaultCommandConsumerGroup, setting); _sendReplyService = new SendReplyService(); _jsonSerializer = ObjectContainer.Resolve <IJsonSerializer>(); _typeNameProvider = ObjectContainer.Resolve <ITypeNameProvider>(); _processor = ObjectContainer.Resolve <IMessageProcessor <ProcessingCommand, ICommand, CommandResult> >(); _repository = ObjectContainer.Resolve <IRepository>(); _aggregateRootStorage = ObjectContainer.Resolve <IAggregateStorage>(); _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName); }
public CommandConsumer InitializeENode() { _sendReplyService = new SendReplyService("CommandConsumerSendReplyService"); _jsonSerializer = ObjectContainer.Resolve <IJsonSerializer>(); _typeNameProvider = ObjectContainer.Resolve <ITypeNameProvider>(); _commandProcessor = ObjectContainer.Resolve <ICommandProcessor>(); _repository = ObjectContainer.Resolve <IRepository>(); _aggregateStorage = ObjectContainer.Resolve <IAggregateStorage>(); _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName); return(this); }
public Repository(IMessageBus <IEvent> eventBus, IAggregateStorage storage, IEventStore eventStore, ISnapshotStore snapshotStore, ICacheProvider cacheProvider) { _eventBus = eventBus; _storage = storage; _eventStore = eventStore; _snapshotStore = snapshotStore; _cacheProvider = cacheProvider; }
public CommandConsumer Initialize(string groupName = null, ConsumerSetting setting = null) { _consumer = new Consumer(groupName ?? DefaultCommandConsumerGroup, setting ?? new ConsumerSetting { ConsumeFromWhere = ConsumeFromWhere.FirstOffset }); _sendReplyService = new SendReplyService(); _jsonSerializer = ObjectContainer.Resolve <IJsonSerializer>(); _typeNameProvider = ObjectContainer.Resolve <ITypeNameProvider>(); _processor = ObjectContainer.Resolve <ICommandProcessor>(); _repository = ObjectContainer.Resolve <IRepository>(); _aggregateRootStorage = ObjectContainer.Resolve <IAggregateStorage>(); _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName); return(this); }
public DefaultEventService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher <DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { var setting = ENodeConfiguration.Instance.Setting; _enableGroupCommit = setting.EnableGroupCommitEvent; _groupCommitInterval = setting.GroupCommitEventIntervalMilliseconds; _groupCommitMaxSize = setting.GroupCommitMaxSize; _ioHelper = ioHelper; Ensure.Positive(_groupCommitInterval, "_groupCommitInterval"); Ensure.Positive(_groupCommitMaxSize, "_groupCommitMaxSize"); _toCommitContextQueue = new ConcurrentQueue <EventCommittingContext>(); _successPersistedContextQueue = new BlockingCollection <IEnumerable <EventCommittingContext> >(); _failedPersistedContextQueue = new BlockingCollection <IEnumerable <EventCommittingContext> >(); _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); _processSuccessPersistedEventsWorker = new Worker("ProcessSuccessPersistedEvents", ProcessSuccessPersistedEvents); _processFailedPersistedEventsWorker = new Worker("ProcessFailedPersistedEvents", ProcessFailedPersistedEvents); Start(); }
public DefaultEventService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher<DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { var setting = ENodeConfiguration.Instance.Setting; _enableGroupCommit = setting.EnableGroupCommitEvent; _groupCommitInterval = setting.GroupCommitEventIntervalMilliseconds; _groupCommitMaxSize = setting.GroupCommitMaxSize; _ioHelper = ioHelper; Ensure.Positive(_groupCommitInterval, "_groupCommitInterval"); Ensure.Positive(_groupCommitMaxSize, "_groupCommitMaxSize"); _toCommitContextQueue = new ConcurrentQueue<EventCommittingContext>(); _successPersistedContextQueue = new BlockingCollection<IEnumerable<EventCommittingContext>>(); _failedPersistedContextQueue = new BlockingCollection<IEnumerable<EventCommittingContext>>(); _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); _processSuccessPersistedEventsWorker = new Worker("ProcessSuccessPersistedEvents", ProcessSuccessPersistedEvents); _processFailedPersistedEventsWorker = new Worker("ProcessFailedPersistedEvents", ProcessFailedPersistedEvents); Start(); }
public DefaultEventService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher<DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { _ioHelper = ioHelper; _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); }
public DefaultEventService( IJsonSerializer jsonSerializer, IScheduleService scheduleService, ITypeNameProvider typeNameProvider, IMemoryCache memoryCache, IAggregateRootFactory aggregateRootFactory, IAggregateStorage aggregateStorage, IEventStore eventStore, IMessagePublisher <DomainEventStreamMessage> domainEventPublisher, IOHelper ioHelper, ILoggerFactory loggerFactory) { _ioHelper = ioHelper; _jsonSerializer = jsonSerializer; _scheduleService = scheduleService; _typeNameProvider = typeNameProvider; _memoryCache = memoryCache; _aggregateRootFactory = aggregateRootFactory; _aggregateStorage = aggregateStorage; _eventStore = eventStore; _domainEventPublisher = domainEventPublisher; _logger = loggerFactory.Create(GetType().FullName); }
public EventSourcingRepository(IMemoryCache memoryCache, IAggregateStorage aggregateRootStorage) { _memoryCache = memoryCache; _aggregateRootStorage = aggregateRootStorage; }
public AlertsStorage(IAggregateStorage aggregateStorage) { _aggregateStorage = aggregateStorage; }
public HistoryAggregator(IHistoryStorage historyStorage, IAggregateStorage aggregateStorage) { _historyStorage = historyStorage; _aggregateStorage = aggregateStorage; }
public EventsController(IAggregateStorage storage, Migration migration) { _storage = storage; _migration = migration; }
public PortfolioStorage(IAggregateStorage aggregateStorage) { _aggregateStorage = aggregateStorage; }
/// <summary> /// Initialize a new instance of <see cref="Session"/> class /// </summary> /// <param name="storage">Persistent aggregate storage</param> public Session(IAggregateStorage storage) { this.storage = storage; }
public DefaultMemoryCache(ITypeCodeProvider aggregateRootTypeCodeProvider, IAggregateStorage aggregateStorage, ILoggerFactory loggerFactory) { _aggregateRootTypeCodeProvider = aggregateRootTypeCodeProvider; _aggregateStorage = aggregateStorage; _logger = loggerFactory.Create(GetType().FullName); }
public EventsController(IAggregateStorage storage) { _storage = storage; }
public DefaultRepository(IMemoryCache memoryCache, IAggregateStorage aggregateRootStorage) { _memoryCache = memoryCache; _aggregateRootStorage = aggregateRootStorage; }
public HealthCheck(IAggregateStorage storage) { _storage = storage; }