Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BootProcedure"/> class.
        /// </summary>
        /// <param name="eventHorizons"><see cref="EventHorizonsConfiguration">Event horizons configuration</see>.</param>
        /// <param name="barrier"><see cref="IBarrier">Barrier</see> to penetrate towards an <see cref="IEventHorizon"/>.</param>
        /// <param name="resourceConfiguration"><see cref="IResourceConfiguration"/> for resources.</param>
        /// <param name="executionContextManager"><see cref="IExecutionContextManager"/> for working with <see cref="ExecutionContext"/>.</param>
        /// <param name="application">The running <see cref="Application"/>.</param>
        /// <param name="boundedContext">The running <see cref="BoundedContext"/>.</param>
        /// <param name="environment">The running environment.</param>
        public BootProcedure(
            EventHorizonsConfiguration eventHorizons,
            IBarrier barrier,
            IResourceConfiguration resourceConfiguration,
            IExecutionContextManager executionContextManager,
            Application application,
            BoundedContext boundedContext,
            Environment environment)
        {
            _eventHorizons         = eventHorizons;
            _barrier               = barrier;
            _resourceConfiguration = resourceConfiguration;

            executionContextManager.SetConstants(application, boundedContext, environment);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of <see cref="EventHorizonsConfigurationManager"/>
        /// </summary>
        /// <param name="serializer"><see cref="ISerializer"/> to use for dealing with configuration as JSON</param>
        /// <param name="logger"><see cref="ILogger"/> to use for logging</param>
        public EventHorizonsConfigurationManager(ISerializer serializer, ILogger logger)
        {
            _serializer = serializer;
            _logger     = logger;
            if (File.Exists(_configurationFile))
            {
                logger.Information("Configuration file found for event horizons, loading it");
                Current = LoadConfig();
            }
            else
            {
                 
                logger.Information("No configuration file for event horizons found - no connections will be made");

                Current = new EventHorizonsConfiguration();
            }
        }