Exemplo n.º 1
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="processMethodInvoker">A <see cref="IProcessMethodInvoker"/> for processing events</param>
 /// <param name="executionContextManager">A <see cref="IExecutionContextManager"/> for getting execution context from</param>
 public CommandContextFactory(
     IUncommittedEventStreamCoordinator uncommittedEventStreamCoordinator,
     IProcessMethodInvoker processMethodInvoker,
     IExecutionContextManager executionContextManager)
 {
     _uncommittedEventStreamCoordinator = uncommittedEventStreamCoordinator;
     _processMethodInvoker    = processMethodInvoker;
     _executionContextManager = executionContextManager;
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
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;
 }
Exemplo n.º 4
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;
 }
Exemplo n.º 5
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};
        }
Exemplo n.º 6
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;
 }
Exemplo n.º 7
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;
 }