예제 #1
0
 public SagaNarratorService(
     ISagaLibrarian sagaLibrarian,
     ISagaNarrator sagaNarrator
     )
 {
     _sagaLibrarian = sagaLibrarian;
     _sagaNarrator = sagaNarrator;
 }
예제 #2
0
 public SagaNarratorService(
     ISagaLibrarian sagaLibrarian,
     ISagaNarrator sagaNarrator
     )
 {
     _sagaLibrarian = sagaLibrarian;
     _sagaNarrator  = sagaNarrator;
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="SagaNarrator"/>
 /// </summary>
 /// <param name="librarian"><see cref="ISagaLibrarian"/> to use for handling sagas</param>
 /// <param name="container"><see cref="IContainer"/> for creating instances</param>
 /// <param name="chapterValidationService"><see cref="IChapterValidationService" /> for validating chapters</param>
 /// <param name="eventStore"></param>
 public SagaNarrator(
     ISagaLibrarian librarian,
     IContainer container,
     IChapterValidationService chapterValidationService,
     IEventStore eventStore)
 {
     _librarian = librarian;
     _container = container;
     _chapterValidationService = chapterValidationService;
     _eventStore = eventStore;
 }
예제 #4
0
 public CommandCoordinatorService(
     ICommandCoordinator commandCoordinator, 
     ISerializer serializer,
     ITypeDiscoverer typeDiscoverer,
     ISagaLibrarian sagaLibrarian)
 {
     _commandCoordinator = commandCoordinator;
     _serializer = serializer;
     _typeDiscoverer = typeDiscoverer;
     _sagaLibrarian = sagaLibrarian;
 }
예제 #5
0
 public CommandCoordinatorService(
     ICommandCoordinator commandCoordinator,
     ISerializer serializer,
     ITypeDiscoverer typeDiscoverer,
     ISagaLibrarian sagaLibrarian)
 {
     _commandCoordinator = commandCoordinator;
     _serializer         = serializer;
     _typeDiscoverer     = typeDiscoverer;
     _sagaLibrarian      = sagaLibrarian;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of <see cref="CommandContextManager">CommandContextManager</see>
 /// </summary>
 /// <param name="eventStore">A <see cref="IEventStore">IEventStore</see> to use for saving events</param>
 /// <param name="sagaLibrarian">A <see cref="ISagaLibrarian"/> for saving sagas to</param>
 /// <param name="processMethodInvoker">A <see cref="IProcessMethodInvoker"/> for processing events</param>
 /// <param name="executionContextManager">A <see cref="IExecutionContextManager"/> for getting execution context from</param>
 public CommandContextManager(
     IEventStore eventStore,
     ISagaLibrarian sagaLibrarian,
     IProcessMethodInvoker processMethodInvoker,
     IExecutionContextManager executionContextManager)
 {
     _eventStore = eventStore;
     _sagaLibrarian = sagaLibrarian;
     _processMethodInvoker = processMethodInvoker;
     _executionContextManager = executionContextManager;
 }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of <see cref="CommandContextFactory">CommandContextFactory</see>
 /// </summary>
 /// <param name="uncommittedEventStreamCoordinator">A <see cref="IUncommittedEventStreamCoordinator"/> to use for coordinator an <see cref="UncommittedEventStream"/></param>
 /// <param name="sagaLibrarian">A <see cref="ISagaLibrarian"/> for saving sagas to</param>
 /// <param name="processMethodInvoker">A <see cref="IProcessMethodInvoker"/> for processing events</param>
 /// <param name="executionContextManager">A <see cref="IExecutionContextManager"/> for getting execution context from</param>
 /// <param name="eventStore">A <see cref="IEventStore"/> that will receive any events generated</param>
 public CommandContextFactory(
     IUncommittedEventStreamCoordinator uncommittedEventStreamCoordinator,
     ISagaLibrarian sagaLibrarian,
     IProcessMethodInvoker processMethodInvoker,
     IExecutionContextManager executionContextManager,
     IEventStore eventStore)
 {
     _uncommittedEventStreamCoordinator = uncommittedEventStreamCoordinator;
     _sagaLibrarian           = sagaLibrarian;
     _processMethodInvoker    = processMethodInvoker;
     _eventStore              = eventStore;
     _executionContextManager = executionContextManager;
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of <see cref="CommandContextFactory">CommandContextFactory</see>
 /// </summary>
 /// <param name="uncommittedEventStreamCoordinator">A <see cref="IUncommittedEventStreamCoordinator"/> to use for coordinator an <see cref="UncommittedEventStream"/></param>
 /// <param name="sagaLibrarian">A <see cref="ISagaLibrarian"/> for saving sagas to</param>
 /// <param name="processMethodInvoker">A <see cref="IProcessMethodInvoker"/> for processing events</param>
 /// <param name="executionContextManager">A <see cref="IExecutionContextManager"/> for getting execution context from</param>
 /// <param name="eventStore">A <see cref="IEventStore"/> that will receive any events generated</param>
 public CommandContextFactory(
     IUncommittedEventStreamCoordinator uncommittedEventStreamCoordinator,
     ISagaLibrarian sagaLibrarian,
     IProcessMethodInvoker processMethodInvoker,
     IExecutionContextManager executionContextManager,
     IEventStore eventStore)
 {
     _uncommittedEventStreamCoordinator = uncommittedEventStreamCoordinator;
     _sagaLibrarian = sagaLibrarian;
     _processMethodInvoker = processMethodInvoker;
     _eventStore = eventStore;
     _executionContextManager = executionContextManager;
 }
예제 #9
0
        /// <summary>
        /// Initializes an instance of the <see cref="SagaCommandContext"/> for a saga
        /// </summary>
        /// <param name="saga"><see cref="ISaga"/> to start the context for</param>
        /// <param name="command"><see cref="ICommand"/> that will be applied </param>
        /// <param name="executionContext">A <see cref="IExecutionContext"/> that is the context of execution for the <see cref="ICommand"/></param>
        /// <param name="eventStore">A <see cref="IEventStore"/> that will receive any events generated</param>
        /// <param name="processMethodInvoker">A <see cref="IProcessMethodInvoker"/> for processing events on the <see cref="ISaga"/></param>
        /// <param name="sagaLibrarian">A <see cref="ISagaLibrarian"/> for dealing with the <see cref="ISaga"/> and persistence</param>
        public SagaCommandContext(
            ISaga saga,
            ICommand command,
            IExecutionContext executionContext,
            IEventStore eventStore,
            IProcessMethodInvoker processMethodInvoker,
            ISagaLibrarian sagaLibrarian)
        {
            Command = command;
            ExecutionContext = executionContext;
            _saga = saga;
            _eventStore = eventStore;
            _processMethodInvoker = processMethodInvoker;
            _sagaLibrarian = sagaLibrarian;

            EventStores = new[] {_eventStore, saga};
        }
예제 #10
0
 /// <summary>
 /// Initializes an instance of the <see cref="SagaCommandContext"/> for a saga
 /// </summary>
 /// <param name="saga"><see cref="ISaga"/> to start the context for</param>
 /// <param name="command"><see cref="ICommand"/> that will be applied </param>
 /// <param name="executionContext">A <see cref="IExecutionContext"/> that is the context of execution for the <see cref="ICommand"/></param>
 /// <param name="eventStore">A <see cref="IEventStore"/> that will receive any events generated</param>
 /// <param name="uncommittedEventStreamCoordinator">A <see cref="IUncommittedEventStreamCoordinator"/> to use for coordinating a <see cref="UncommittedEventStream"/></param>
 /// <param name="processMethodInvoker">A <see cref="IProcessMethodInvoker"/> for processing events on the <see cref="ISaga"/></param>
 /// <param name="sagaLibrarian">A <see cref="ISagaLibrarian"/> for dealing with the <see cref="ISaga"/> and persistence</param>
 public SagaCommandContext(
     ISaga saga,
     ICommand command,
     IExecutionContext executionContext,
     IEventStore eventStore,
     IUncommittedEventStreamCoordinator uncommittedEventStreamCoordinator,
     IProcessMethodInvoker processMethodInvoker,
     ISagaLibrarian sagaLibrarian)
 {
     Command = command;
     ExecutionContext = executionContext;
     _saga = saga;
     _eventStore = eventStore;
     _uncommittedEventStreamCoordinator = uncommittedEventStreamCoordinator;
     _processMethodInvoker = processMethodInvoker;
     _sagaLibrarian = sagaLibrarian;
 }
예제 #11
0
 /// <summary>
 /// Initializes an instance of the <see cref="SagaCommandContext"/> for a saga
 /// </summary>
 /// <param name="saga"><see cref="ISaga"/> to start the context for</param>
 /// <param name="command"><see cref="ICommand"/> that will be applied </param>
 /// <param name="executionContext">A <see cref="IExecutionContext"/> that is the context of execution for the <see cref="ICommand"/></param>
 /// <param name="eventStore">A <see cref="IEventStore"/> that will receive any events generated</param>
 /// <param name="uncommittedEventStreamCoordinator">A <see cref="IUncommittedEventStreamCoordinator"/> to use for coordinating a <see cref="UncommittedEventStream"/></param>
 /// <param name="processMethodInvoker">A <see cref="IProcessMethodInvoker"/> for processing events on the <see cref="ISaga"/></param>
 /// <param name="sagaLibrarian">A <see cref="ISagaLibrarian"/> for dealing with the <see cref="ISaga"/> and persistence</param>
 public SagaCommandContext(
     ISaga saga,
     ICommand command,
     IExecutionContext executionContext,
     IEventStore eventStore,
     IUncommittedEventStreamCoordinator uncommittedEventStreamCoordinator,
     IProcessMethodInvoker processMethodInvoker,
     ISagaLibrarian sagaLibrarian)
 {
     Command          = command;
     ExecutionContext = executionContext;
     _saga            = saga;
     _eventStore      = eventStore;
     _uncommittedEventStreamCoordinator = uncommittedEventStreamCoordinator;
     _processMethodInvoker = processMethodInvoker;
     _sagaLibrarian        = sagaLibrarian;
 }
예제 #12
0
		public CommentsController(ISagaNarrator sagaNarrator, ISagaLibrarian librarian)
		{
			_sagaNarrator = sagaNarrator;
			_librarian = librarian;
		}