Exemple #1
0
 static void AssignBindings()
 {
     _artifactTypes = _bootLoaderResult.Container.Get <DolittleArtifactTypes>();
     _topologyConfigurationHandler  = _bootLoaderResult.Container.Get <TopologyConfigurationHandler>();
     _artifactsConfigurationHandler = _bootLoaderResult.Container.Get <ArtifactsConfigurationHandler>();
     _boundedContextLoader          = _bootLoaderResult.Container.Get <IBoundedContextLoader>();
 }
Exemple #2
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);
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of <see cref="BootProcedure"/>
        /// </summary>
        /// <param name="configuration"><see cref="IEventHorizonsConfigurationManager">Configuration mananger</see></param>
        /// <param name="barrier"><see cref="IBarrier">Barrier</see> to penetrate towards an <see cref="IEventHorizon"/></param>
        /// <param name="resourceConfiguration"></param>
        /// <param name="boundedContextLoader"></param>
        /// <param name="executionContextManager"></param>
        /// <param name="environment">The running environment</param>
        public BootProcedure(
            IEventHorizonsConfigurationManager configuration,
            IBarrier barrier,
            IResourceConfiguration resourceConfiguration,
            IBoundedContextLoader boundedContextLoader,
            IExecutionContextManager executionContextManager,
            Environment environment)
        {
            _configuration         = configuration;
            _barrier               = barrier;
            _resourceConfiguration = resourceConfiguration;
            _boundedContextLoader  = boundedContextLoader;

            var boundedContextConfig = boundedContextLoader.Load();

            executionContextManager.SetConstants(boundedContextConfig.Application, boundedContextConfig.BoundedContext, environment);
        }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildTask"/> class.
 /// </summary>
 /// <param name="buildTarget">Current <see cref="BuildTarget"/>.</param>
 /// <param name="configuration">Current <see cref="BuildTaskConfiguration"/>.</param>
 /// <param name="boundedContextLoader"><see cref="IBoundedContextLoader"/> for loading bounded-context.json.</param>
 /// <param name="artifactTypes">Known <see cref="ArtifactTypes"/>.</param>
 /// <param name="topologyConfigurationHandler"><see cref="TopologyConfigurationHandler"/> for handling topology configuration.</param>
 /// <param name="artifactsConfigurationHandler"><see cref="ArtifactsConfigurationHandler"/> for handling artifacts configuration.</param>
 /// <param name="proxiesHandler"><see cref="ProxiesHandler"/> for dealing with proxies.</param>
 /// <param name="buildMessages"><see cref="IBuildMessages"/> for build messages.</param>
 public BuildTask(
     BuildTarget buildTarget,
     BuildTaskConfiguration configuration,
     IBoundedContextLoader boundedContextLoader,
     ArtifactTypes artifactTypes,
     TopologyConfigurationHandler topologyConfigurationHandler,
     ArtifactsConfigurationHandler artifactsConfigurationHandler,
     ProxiesHandler proxiesHandler,
     IBuildMessages buildMessages)
 {
     _configuration                 = configuration;
     _boundedContextLoader          = boundedContextLoader;
     _artifactTypes                 = artifactTypes;
     _buildMessages                 = buildMessages;
     _topologyConfigurationHandler  = topologyConfigurationHandler;
     _artifactsConfigurationHandler = artifactsConfigurationHandler;
     _proxiesHandler                = proxiesHandler;
     _buildTarget = buildTarget;
 }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of <see cref="Barrier"/>
        /// </summary>
        /// <param name="getGeodesics">A <see cref="FactoryFor{IGeodesics}"/> to get the correctly scoped geodesics for path offsetting</param>
        /// <param name="serializer"><see cref="ISerializer"/> used for serialization</param>
        /// <param name="getEventStore">A <see cref="FactoryFor{IEventStore}"/> to get the correctly scoped EventStore to persist incoming events to</param>
        /// <param name="eventProcessingHub"><see cref="IScopedEventProcessingHub"/> for processing incoming events</param>
        /// <param name="logger"><see cref="ILogger"/> for logging purposes</param>
        /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> to set the correct context for processing events</param>
        /// <param name="tenants"><see cref="ITenants"/> all the tenants that we will process events for</param>
        /// <param name="tenantOffsetRepository"></param>
        /// <param name="boundedContextLoader"></param>
        public Barrier(
            FactoryFor <IGeodesics> getGeodesics,
            ISerializer serializer,
            FactoryFor <IEventStore> getEventStore,
            IScopedEventProcessingHub eventProcessingHub,
            ILogger logger,
            IExecutionContextManager executionContextManager,
            ITenants tenants,
            ITenantOffsetRepository tenantOffsetRepository,
            IBoundedContextLoader boundedContextLoader)
        {
            _logger                  = logger;
            _getGeodesics            = getGeodesics;
            _serializer              = serializer;
            _getEventStore           = getEventStore;
            _eventProcessingHub      = eventProcessingHub;
            _executionContextManager = executionContextManager;
            _tenants                 = tenants;
            _tenantOffsetRepository  = tenantOffsetRepository;

            var boundedContextConfig = boundedContextLoader.Load();

            _key = new EventHorizonKey(boundedContextConfig.Application, boundedContextConfig.BoundedContext);
        }
Exemple #6
0
 /// <summary>
 /// Instantiates an instance of <see cref="BootProcedure"/>
 /// </summary>
 /// <param name="boundedContextLoader"></param>
 /// <param name="executionContextManager"></param>
 /// <param name="resourceConfiguration"></param>
 public BootProcedure(IBoundedContextLoader boundedContextLoader, IExecutionContextManager executionContextManager, IResourceConfiguration resourceConfiguration)
 {
     _boundedContextLoader    = boundedContextLoader;
     _executionContextManager = executionContextManager;
     _resourceConfiguration   = resourceConfiguration;
 }