Пример #1
0
        public AccountsController(IAccountsServiceEx accountsService,
                                  IExecutionContextManager executionContextManager,
                                  IDataAccessService dataAccessService,
                                  ILoggerService loggerService,
                                  ITranslatorsRepository translatorsRepository,
                                  IIntegrationIdPRepository integrationIdPRepository,
                                  IOptions <AppSettings> appSettings)
        {
            if (loggerService is null)
            {
                throw new ArgumentNullException(nameof(loggerService));
            }

            if (appSettings is null)
            {
                throw new ArgumentNullException(nameof(appSettings));
            }

            _accountsService          = accountsService;
            _executionContextManager  = executionContextManager;
            _dataAccessService        = dataAccessService;
            _translatorsRepository    = translatorsRepository;
            _integrationIdPRepository = integrationIdPRepository;
            _logger      = loggerService.GetLogger(nameof(AccountsController));
            _appSettings = appSettings.Value;
        }
 /// <summary>
 /// Instantiates an instance of <see cref="BuildPodProcessor" />
 /// </summary>
 /// <param name="executionContextManager">The <see cref="IExecutionContextManager" /> for setting the correct <see cref="Tenant"/> context</param>
 /// <param name="handleBuildSteps">A <see cref="IHandleBuildSteps" /> for handling each build step</param>
 /// <param name="getTracker">A factory for building instances of <see cref="IBuildStepsStatusTracker" /> for tracking the status of individual build steps</param>
 /// <param name="logger">A logger for logging</param>
 public BuildPodProcessor(IExecutionContextManager executionContextManager, IHandleBuildSteps handleBuildSteps, FactoryFor <IBuildStepsStatusTracker> getTracker, ILogger logger)
 {
     _logger                  = logger;
     _handleBuildSteps        = handleBuildSteps;
     _getTracker              = getTracker;
     _executionContextManager = executionContextManager;
 }
Пример #3
0
 public AccountsService(IDataAccessService dataAccessService, IExecutionContextManager executionContextManager, IIdentityAttributesService identityAttributesService, IGatewayService gatewayService)
 {
     _dataAccessService         = dataAccessService;
     _executionContextManager   = executionContextManager;
     _identityAttributesService = identityAttributesService;
     _gatewayService            = gatewayService;
 }
Пример #4
0
 public Boot(IExecutionContextManager contextManager, ITenants tenants, FactoryFor <ConfigurationManager> configurationManagerFactory, ILogger logger)
 {
     _contextManager = contextManager;
     _tenants        = tenants;
     _configurationManagerFactory = configurationManagerFactory;
     _logger = logger;
 }
Пример #5
0
 public LocalAuthenticator(ICanResolveTenantsForProviderSubjects mapper, IExecutionContextManager manager, FactoryFor <ICanResolveUserForProviderSubjects> userMapperFactory, ICanGenerateTenantPrincipal generator)
 {
     _mapper            = mapper;
     _manager           = manager;
     _userMapperFactory = userMapperFactory;
     _generator         = generator;
 }
Пример #6
0
        /// <summary>
        /// Instantiates a new instance of <see cref="BootProcedure" />
        /// </summary>
        /// <param name="systemsThatKnowAboutEventProcessors">Provides <see cref="IEventProcessor">Event Processors</see></param>
        /// <param name="tenants">A collection of all <see cref="ITenants">tenants</see></param>
        /// <param name="processingHub">An instance of <see cref="IScopedEventProcessingHub" /> for processing <see cref="CommittedEventStream">Committed Event Streams</see></param>
        /// <param name="getOffsetRepository">A factory function to return a correctly scoped instance of <see cref="IEventProcessorOffsetRepository" /></param>
        /// <param name="getUnprocessedEventsFetcher">A factory function to return a correctly scoped instance of <see cref="IFetchUnprocessedEvents" /></param>
        /// <param name="executionContextManager">The <see cref="ExecutionContextManager" /> for setting the correct execution context for the Event Processors </param>
        /// <param name="resourceConfiguration"></param>
        /// <param name="boundedContextLoader"></param>
        /// <param name="environment"></param>
        /// <param name="logger">An instance of <see cref="ILogger" /> for logging</param>
        public BootProcedure(
            IInstancesOf <IKnowAboutEventProcessors> systemsThatKnowAboutEventProcessors,
            ITenants tenants,
            IScopedEventProcessingHub processingHub,
            FactoryFor <IEventProcessorOffsetRepository> getOffsetRepository,
            FactoryFor <IFetchUnprocessedEvents> getUnprocessedEventsFetcher,
            IExecutionContextManager executionContextManager,
            IResourceConfiguration resourceConfiguration,
            IBoundedContextLoader boundedContextLoader,
            Execution.Environment environment,
            ILogger logger)
        {
            _processingHub = processingHub;
            _logger        = logger;
            _tenants       = tenants;
            _systemsThatKnowAboutEventProcessors = systemsThatKnowAboutEventProcessors;
            _getOffsetRepository         = getOffsetRepository;
            _getUnprocessedEventsFetcher = getUnprocessedEventsFetcher;
            _executionContextManager     = executionContextManager;
            _resourceConfiguration       = resourceConfiguration;
            _logger = logger;

            var boundedContextConfig = boundedContextLoader.Load();

            _executionContextManager.SetConstants(boundedContextConfig.Application, boundedContextConfig.BoundedContext, environment);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReverseCallClient{TClientMessage, TServerMessage, TConnectArguments, TConnectResponse, TRequest, TResponse}"/> class.
 /// </summary>
 /// <param name="establishConnection">The <see cref="AsyncDuplexStreamingCall{TRequest, TResponse}" />.</param>
 /// <param name="setConnectArguments">A delegate to set the <typeparamref name="TConnectArguments" /> on a <typeparamref name="TClientMessage" />.</param>
 /// <param name="getConnectResponse">A delegate to get the <typeparamref name="TConnectResponse" /> from a <typeparamref name="TServerMessage" />.</param>
 /// <param name="getMessageRequest">A delegate to get the <typeparamref name="TRequest" /> from the <typeparamref name="TServerMessage" />.</param>
 /// <param name="setMessageResponse">A delegate to set the <typeparamref name="TResponse" /> on a <typeparamref name="TClientMessage" />.</param>
 /// <param name="setArgumentsContext">A delegate to set the <see cref="ReverseCallArgumentsContext" /> on a <typeparamref name="TConnectArguments" />.</param>
 /// <param name="getRequestContext">A delegate to get the <see cref="ReverseCallRequestContext" /> from the <typeparamref name="TRequest" />.</param>
 /// <param name="setResponseContext">A delegate to set the <see cref="ReverseCallResponseContext" /> on a <typeparamref name="TResponse" />.</param>
 /// <param name="getPing">A delegate to get the <see cref="Ping" /> from the <typeparamref name="TServerMessage" />.</param>
 /// <param name="setPong">A delegate to set the <see cref="Ping" /> on a <typeparamref name="TClientMessage" />.</param>
 /// <param name="pingInterval">A <see cref="TimeSpan" /> for the interval between pings from the server.</param>
 /// <param name="executionContextManager">The <see cref="IExecutionContextManager" />.</param>
 /// <param name="logger">The <see cref="ILogger" />.</param>
 public ReverseCallClient(
     Func <AsyncDuplexStreamingCall <TClientMessage, TServerMessage> > establishConnection,
     Action <TClientMessage, TConnectArguments> setConnectArguments,
     Func <TServerMessage, TConnectResponse> getConnectResponse,
     Func <TServerMessage, TRequest> getMessageRequest,
     Action <TClientMessage, TResponse> setMessageResponse,
     Action <TConnectArguments, ReverseCallArgumentsContext> setArgumentsContext,
     Func <TRequest, ReverseCallRequestContext> getRequestContext,
     Action <TResponse, ReverseCallResponseContext> setResponseContext,
     Func <TServerMessage, Ping> getPing,
     Action <TClientMessage, Pong> setPong,
     TimeSpan pingInterval,
     IExecutionContextManager executionContextManager,
     ILogger logger)
 {
     ThrowIfInvalidPingInterval(pingInterval);
     _establishConnection     = establishConnection;
     _setConnectArguments     = setConnectArguments;
     _getConnectResponse      = getConnectResponse;
     _getMessageRequest       = getMessageRequest;
     _setMessageResponse      = setMessageResponse;
     _setArgumentsContext     = setArgumentsContext;
     _getRequestContext       = getRequestContext;
     _setResponseContext      = setResponseContext;
     _getPing                 = getPing;
     _setPong                 = setPong;
     _pingInterval            = pingInterval;
     _executionContextManager = executionContextManager;
     _logger = logger;
 }
Пример #8
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            RuleRegistrationSource.Container = app.ApplicationServices.GetService(typeof(Dolittle.DependencyInversion.IContainer)) as Dolittle.DependencyInversion.IContainer;

            _executionContextManager = app.ApplicationServices.GetService(typeof(IExecutionContextManager)) as IExecutionContextManager;

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); });
            }
            app.UseCors(builder => builder
                        .AllowAnyHeader()
                        .AllowAnyMethod()
                        .AllowAnyOrigin()
                        .AllowCredentials());
            app.UseMvc();
            if (env.IsDevelopment())
            {
                app.UseSwagger();
            }

            app.UseDolittle();

            app.UseDefaultFiles();
            app.UseStaticFiles();

            ConfigureCustom(app, env);

            // Keep last
            app.RunAsSinglePageApplication();
        }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScopedEventProcessingHub"/> class.
 /// </summary>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> for working with <see cref="ExecutionContext"/>.</param>
 /// <param name="logger"><see cref="ILogger"/> for logging.</param>
 public ScopedEventProcessingHub(
     IExecutionContextManager executionContextManager,
     ILogger logger)
 {
     _executionContextManager = executionContextManager;
     _logger = logger;
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConsumerClient"/> class.
 /// </summary>
 /// <param name="clientManager">The <see cref="IClientManager" />.</param>
 /// <param name="subscriptions">The <see cref="ISubscriptions" />.</param>
 /// <param name="microservicesConfiguration">The <see cref="MicroservicesConfiguration" />.</param>
 /// <param name="streamProcessorStates">The <see cref="IStreamProcessorStateRepository" />.</param>
 /// <param name="eventHorizonEventsWriter">The <see cref="IWriteEventHorizonEvents" />.</param>
 /// <param name="policy">The <see cref="IAsyncPolicyFor{T}" /> <see cref="ConsumerClient" />.</param>
 /// <param name="eventProcessorPolicy">The <see cref="IAsyncPolicyFor{T}" /> <see cref="EventProcessor" />.</param>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager" />.</param>
 /// <param name="reverseCallClients"><see cref="IReverseCallClients"/>.</param>
 /// <param name="logger">The <see cref="ILogger" />.</param>
 public ConsumerClient(
     IClientManager clientManager,
     ISubscriptions subscriptions,
     MicroservicesConfiguration microservicesConfiguration,
     IStreamProcessorStateRepository streamProcessorStates,
     IWriteEventHorizonEvents eventHorizonEventsWriter,
     IAsyncPolicyFor <ConsumerClient> policy,
     IAsyncPolicyFor <EventProcessor> eventProcessorPolicy,
     IExecutionContextManager executionContextManager,
     IReverseCallClients reverseCallClients,
     ILogger logger)
 {
     _clientManager = clientManager;
     _subscriptions = subscriptions;
     _microservicesConfiguration = microservicesConfiguration;
     _streamProcessorStates      = streamProcessorStates;
     _eventHorizonEventsWriter   = eventHorizonEventsWriter;
     _policy = policy;
     _eventProcessorPolicy    = eventProcessorPolicy;
     _executionContextManager = executionContextManager;
     _logger = logger;
     _cancellationTokenSource = new CancellationTokenSource();
     _cancellationToken       = _cancellationTokenSource.Token;
     _reverseCallClients      = reverseCallClients;
 }
Пример #11
0
        /// <inheritdoc/>
        public void Perform(LoggingSettings settings, IBootStageBuilder builder)
        {
            var entryAssembly = builder.GetAssociation(WellKnownAssociations.EntryAssembly) as Assembly;
            var environment   = builder.GetAssociation(WellKnownAssociations.Environment) as Environment;

            _initialExecutionContext = ExecutionContextManager.SetInitialExecutionContext();

#pragma warning disable CA2000
            var loggerFactory = settings.LoggerFactory ?? new LoggerFactory();
#pragma warning restore CA2000

            _isProduction = environment == Environment.Production;

            var logAppender = settings.LogAppender;

            if (logAppender == null)
            {
                logAppender = (_isProduction && !settings.UseDefaultInAllEnvironments) ?
                              new JsonLogAppender(GetCurrentLoggingContext) :
                              new DefaultLogAppender(GetCurrentLoggingContext, loggerFactory) as ILogAppender;
            }

            var logAppenders = Dolittle.Logging.Bootstrap.Boot.Start(logAppender, entryAssembly);
            Dolittle.Logging.ILogger logger = settings.Logger ?? new Logger(logAppenders);
            logger.Information($"<********* BOOTSTAGE : Logging *********>");

            builder.Associate(WellKnownAssociations.Logger, logger);

            _executionContextManager = new ExecutionContextManager(logger);

            builder.Bindings.Bind <Dolittle.Logging.ILogger>().To(logger);
            builder.Bindings.Bind <ILoggerFactory>().To(loggerFactory);
            builder.Bindings.Bind <IExecutionContextManager>().To(_executionContextManager);
        }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReverseCallDispatcher{TClientMessage, TServerMessage, TConnectArguments, TConnectResponse, TRequest, TResponse}"/> class.
 /// </summary>
 /// <param name="clientStream">The <see cref="IAsyncStreamReader{TClientMessage}"/> to read client messages from.</param>
 /// <param name="serverStream">The <see cref="IServerStreamWriter{TServerMessage}"/> to write server messages to.</param>
 /// <param name="context">The connection <see cref="ServerCallContext">context</see>.</param>
 /// <param name="getConnectArguments">A delegate to get the <typeparamref name="TConnectArguments"/> from a <typeparamref name="TClientMessage"/>.</param>
 /// <param name="setConnectResponse">A delegate to set the <typeparamref name="TConnectResponse"/> on a <typeparamref name="TServerMessage"/>.</param>
 /// <param name="setMessageRequest">A delegate to set the <typeparamref name="TRequest"/> on a <typeparamref name="TServerMessage"/>.</param>
 /// <param name="getMessageResponse">A delegate to get the <typeparamref name="TResponse"/> from a <typeparamref name="TClientMessage"/>.</param>
 /// <param name="getArgumentsContext">A delegate to get the <see cref="ReverseCallArgumentsContext"/> from a <typeparamref name="TConnectArguments"/>.</param>
 /// <param name="setRequestContext">A delegate to set the <see cref="ReverseCallRequestContext"/> on a <typeparamref name="TRequest"/>.</param>
 /// <param name="getResponseContex">A delegate to get the <see cref="ReverseCallResponseContext"/> from a <typeparamref name="TResponse"/>.</param>
 /// <param name="setPing">A delegate to set the <see cref="Ping" /> on a <typeparamref name="TServerMessage" />.</param>
 /// <param name="getPong">A delegate to get the <see cref="Pong" /> from a <typeparamref name="TClientMessage" />.</param>
 /// <param name="executionContextManager">The <see cref="IExecutionContextManager"/> to use.</param>
 /// <param name="logger">The <see cref="ILogger"/> to use.</param>
 public ReverseCallDispatcher(
     IAsyncStreamReader <TClientMessage> clientStream,
     IServerStreamWriter <TServerMessage> serverStream,
     ServerCallContext context,
     Func <TClientMessage, TConnectArguments> getConnectArguments,
     Action <TServerMessage, TConnectResponse> setConnectResponse,
     Action <TServerMessage, TRequest> setMessageRequest,
     Func <TClientMessage, TResponse> getMessageResponse,
     Func <TConnectArguments, ReverseCallArgumentsContext> getArgumentsContext,
     Action <TRequest, ReverseCallRequestContext> setRequestContext,
     Func <TResponse, ReverseCallResponseContext> getResponseContex,
     Action <TServerMessage, Ping> setPing,
     Func <TClientMessage, Pong> getPong,
     IExecutionContextManager executionContextManager,
     ILogger logger)
 {
     _clientStream            = clientStream;
     _serverStream            = serverStream;
     _context                 = context;
     _getConnectArguments     = getConnectArguments;
     _setConnectResponse      = setConnectResponse;
     _setMessageRequest       = setMessageRequest;
     _getMessageResponse      = getMessageResponse;
     _getArgumentsContext     = getArgumentsContext;
     _setRequestContext       = setRequestContext;
     _getResponseContex       = getResponseContex;
     _setPing                 = setPing;
     _getPong                 = getPong;
     _executionContextManager = executionContextManager;
     _logger = logger;
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandCoordinator"/> class.
 /// </summary>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> for working with <see cref="ExecutionContext"/>.</param>
 /// <param name="runtimeCommandCoordinator"><see cref="IRuntimeCommandCoordinator"/> for handling commands.</param>
 public CommandCoordinator(
     IExecutionContextManager executionContextManager,
     IRuntimeCommandCoordinator runtimeCommandCoordinator)
 {
     _executionContextManager   = executionContextManager;
     _runtimeCommandCoordinator = runtimeCommandCoordinator;
 }
 public CustomFrontendServer(IPortalContextManager portalManager, IFileSystem sharedFiles, IFiles tenantFiles, IExecutionContextManager executionContextManager)
 {
     _portalManager           = portalManager;
     _sharedFiles             = sharedFiles;
     _tenantFiles             = tenantFiles;
     _contentTypeProvider     = new FileExtensionContentTypeProvider();
     _executionContextManager = executionContextManager;
 }
        /// <summary>
        /// Instantiates an instance of <see cref="GitHubUserTokenStore" />
        /// </summary>
        /// <param name="executionContextManager">The execution context manager</param>
        public GitHubUserTokenStore(
            IExecutionContextManager executionContextManager
            )
        {
            _executionContextManager = executionContextManager;

            _generator = new RNGCryptoServiceProvider();
        }
Пример #16
0
 /// <summary>
 /// Initializes a new instance of <see cref="BootProcedures"/>
 /// </summary>
 /// <param name="procedures"></param>
 /// <param name="logger"></param>
 /// <param name="executionContextManager"></param>
 public BootProcedures(
     IInstancesOf <ICanPerformBootProcedure> procedures,
     ILogger logger,
     IExecutionContextManager executionContextManager)
 {
     _procedures = procedures;
     _logger     = logger;
     _executionContextManager = executionContextManager;
 }
Пример #17
0
 public AvailableTenants(
     ICanResolveTenantsForProviderSubjects mapper,
     IHttpContextAccessor httpContextAccessor,
     IExecutionContextManager executionContextManager)
 {
     _mapper = mapper;
     _executionContextManager = executionContextManager;
     _httpContextAccessor     = httpContextAccessor;
 }
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QueryCoordinator"/> class.
 /// </summary>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> for working with <see cref="ExecutionContext"/>.</param>
 /// <param name="runtimeQueryCoordinator"><see cref="IRuntimeQueryCoordinator"/> for coordinating queries.</param>
 /// <param name="container"><see cref="IContainer"/> for getting instances of queries.</param>
 public QueryCoordinator(
     IExecutionContextManager executionContextManager,
     IRuntimeQueryCoordinator runtimeQueryCoordinator,
     IContainer container)
 {
     _executionContextManager = executionContextManager;
     _runtimeQueryCoordinator = runtimeQueryCoordinator;
     _container = container;
 }
Пример #19
0
 public Reactions(
     IExecutionContextManager executionContextManager,
     ICommandContextManager commandContextManager,
     IContainer container)
 {
     _executionContextManager = executionContextManager;
     _commandContextManager   = commandContextManager;
     _container = container;
 }
Пример #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BootProcedure"/> class.
 /// </summary>
 /// <param name="boundedContextConfiguration"><see cref="BoundedContextConfiguration"/> to use.</param>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> to use for <see cref="ExecutionContext"/>.</param>
 /// <param name="resourceConfiguration"><see cref="IResourceConfiguration">Configuration</see> of resources.</param>
 public BootProcedure(
     BoundedContextConfiguration boundedContextConfiguration,
     IExecutionContextManager executionContextManager,
     IResourceConfiguration resourceConfiguration)
 {
     _executionContextManager     = executionContextManager;
     _resourceConfiguration       = resourceConfiguration;
     _boundedContextConfiguration = boundedContextConfiguration;
 }
Пример #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventStoreService"/> class.
 /// </summary>
 /// <param name="eventStoreFactory"><see cref="IEventStore"/>.</param>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager" />.</param>
 /// <param name="logger"><see cref="ILogger"/> for logging.</param>
 public EventStoreService(
     FactoryFor <IEventStore> eventStoreFactory,
     IExecutionContextManager executionContextManager,
     ILogger <EventStoreService> logger)
 {
     _eventStoreFactory       = eventStoreFactory;
     _executionContextManager = executionContextManager;
     _logger = logger;
 }
Пример #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandContextFactory"/> class.
 /// </summary>
 /// <param name="uncommittedEventStreamCoordinator">A <see cref="IUncommittedEventStreamCoordinator"/> to use for coordinator an <see cref="UncommittedEvents"/>.</param>
 /// <param name="executionContextManager">A <see cref="IExecutionContextManager"/> for getting execution context from.</param>
 /// <param name="logger"><see cref="ILogger"/> to use for logging.</param>
 public CommandContextFactory(
     IUncommittedEventStreamCoordinator uncommittedEventStreamCoordinator,
     IExecutionContextManager executionContextManager,
     ILogger logger)
 {
     _uncommittedEventStreamCoordinator = uncommittedEventStreamCoordinator;
     _executionContextManager           = executionContextManager;
     _logger = logger;
 }
 /// <summary>
 /// Instantiates an instance of <see cref="ImprovementResultHandler" />
 /// </summary>
 /// <param name="executionContextManager">An <see cref="IExecutionContextManager" /> for accessing the current <see cref="ExecutionContext" /></param>
 /// <param name="commandContextManager">An <see cref="ICommandContextManager" /> for creating a <see cref="ICommandContext" /></param>
 /// <param name="repository">A repository for accessing a <see cref="Improvement" /></param>
 public ImprovementResultHandler(
     IExecutionContextManager executionContextManager,
     ICommandContextManager commandContextManager,
     IAggregateRootRepositoryFor <Improvement> repository)
 {
     _executionContextManager = executionContextManager;
     _commandContextManager   = commandContextManager;
     _repository = repository;
 }
Пример #24
0
 /// <summary>
 /// Initializes a new instance of <see cref="Files"/>
 /// </summary>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> to use for determining the current tenant</param>
 /// <param name="configuration"><see cref="FilesConfiguration">Configuration</see></param>
 /// <param name="fileSystem">Underlying <see cref="IFileSystem"/></param>
 public Files(
     IExecutionContextManager executionContextManager,
     IConfigurationFor <FilesConfiguration> configuration,
     IFileSystem fileSystem)
 {
     _executionContextManager = executionContextManager;
     _fileSystem    = fileSystem;
     _configuration = configuration.Instance;
 }
Пример #25
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;
 }
 public WebhookCoordinator(
     ITenantMapper tenantMapper,
     FactoryFor <IWebhookScheduler> schedulerFactory,
     IExecutionContextManager executionContextManager
     )
 {
     _tenantMapper            = tenantMapper;
     _schedulerFactory        = schedulerFactory;
     _executionContextManager = executionContextManager;
 }
Пример #27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BootProcedure"/> class.
        /// </summary>
        /// <param name="container">The <see cref="IContainer"/>.</param>
        /// <param name="executionContextManager">The <see cref="IExecutionContextManager"/> for managing <see cref="ExecutionContext"/>.</param>
        /// <param name="jsRuntime">The <see cref="IJSRuntime"/>.</param>
        public BootProcedure(
            IContainer container,
            IExecutionContextManager executionContextManager,
            IJSRuntime jsRuntime)
        {
            _jsRuntime = jsRuntime;

            executionContextManager.CurrentFor(TenantId.Development);
            _configurationFor = container.Get <IConfigurationFor <Configuration> >();
        }
Пример #28
0
 public ServiceProvidersController(IAccountsService accountsService, IExecutionContextManager executionContextManager, IDataAccessService dataAccessService, IIdentityAttributesService identityAttributesService, IHashCalculationsRepository hashCalculationsRepository, IAssetsService assetsService, IOptions <AppSettings> appSettings)
 {
     _accountsService           = accountsService;
     _executionContextManager   = executionContextManager;
     _dataAccessService         = dataAccessService;
     _identityAttributesService = identityAttributesService;
     _assetsService             = assetsService;
     _appSettings     = appSettings.Value;
     _hashCalculation = hashCalculationsRepository.Create(Globals.DEFAULT_HASH);
 }
Пример #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExecutionContextSetup"/> class.
 /// </summary>
 /// <param name="next">Next middleware.</param>
 /// <param name="options">Configuration in form of <see cref="ExecutionContextSetupOptions"/>.</param>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> for working with <see cref="ExecutionContext"/>.</param>
 /// <param name="logger"><see cref="ILogger"/> for logging.</param>
 public ExecutionContextSetup(
     RequestDelegate next,
     IOptionsMonitor <ExecutionContextSetupOptions> options,
     IExecutionContextManager executionContextManager,
     ILogger logger)
 {
     _next    = next;
     _options = options;
     _executionContextManager = executionContextManager;
     _logger = logger;
 }
Пример #30
0
 /// <summary>
 /// Initializes a new instance of <see cref="CommandCoordinator"/>
 /// </summary>
 /// <param name="serializer"><see cref="ISerializer"/> for JSON serialization</param>
 /// <param name="commandCoordinator">The actual runtime <see cref="ICommandCoordinator"/></param>
 /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> for working with execution contexts</param>
 /// <param name="logger"><see cref="ILogger"/> used for logging</param>
 public CommandCoordinator(
     ISerializer serializer,
     ICommandCoordinator commandCoordinator,
     IExecutionContextManager executionContextManager,
     ILogger logger)
 {
     _serializer              = serializer;
     _commandCoordinator      = commandCoordinator;
     _executionContextManager = executionContextManager;
     _logger = logger;
 }
Пример #31
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;
 }
Пример #32
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;
 }