Пример #1
0
        /// <summary>
        /// Initialises the service
        /// </summary>
        /// <returns></returns>
        public void Start()
        {
            var startables = _container.GetAllInstances <IStartable>()
                             .OrderBy(x => (byte)x.StartupPriority)
                             .ToList();

            foreach (var startable in startables)
            {
                startable.Start();
            }

            _logger.Info($"{nameof(Service)}.{nameof(Start)}",
                         new LogItem("Event", "Service Started"),
                         new LogItem("Name", ServiceInfo.Name));
        }
Пример #2
0
        public void Start()
        {
            var dataEntities = _containerFacade.GetAllInstances <DataEntityBase>();

            foreach (var dataEntity in dataEntities)
            {
                var method = typeof(MongoStore).GetMethod(nameof(GetOrCreateCollection),
                                                          BindingFlags.NonPublic | BindingFlags.Instance);
                method.MakeGenericMethod(dataEntity.GetType()).Invoke(this, new object[] { });
            }
        }
        public void Start()
        {
            var dataEntities = _containerFacade.GetAllInstances <DataEntity>();

            foreach (var dataEntity in dataEntities)
            {
                var method = typeof(DynamoStore).GetMethod(nameof(GetOrCreateTable), BindingFlags.NonPublic | BindingFlags.Instance);
                if (method != null)
                {
                    method.MakeGenericMethod(dataEntity.GetType()).Invoke(this, new object[] { });
                }
            }

            SetupHealthCheck();
        }
Пример #4
0
        private bool TryFindConsumer(Guid type, out IBackplaneConsumer consumer)
        {
            consumer = _container.GetAllInstances <IBackplaneConsumer>().FirstOrDefault(x => x.ConsumesType == type);

            return(consumer != null);
        }