Ejemplo n.º 1
0
        /// <summary>
        /// 启动引擎
        /// </summary>
        public static void BootEngine(EngineParam engineParam)
        {
            #region 配置服务初始化
            IAppConfigManage appConfig      = Get <IAppConfigManage>();
            AppConfigParam   appConfigParam = new AppConfigParam()
            {
                UserConfigPath = engineParam.AppConfigPath
            };
            appConfig.LoadConfigs(appConfigParam);
            #endregion

            #region 日志服务初始化
            ILogContext log = Get <ILogContext>();
            log.Init(@engineParam.LogConfigPath);
            #endregion

            #region 缓存服务初始化
            ScrapyCachePool cache = Get <ICachePool>() as ScrapyCachePool;
            cache.Init();
            ScrapyCachePool.LogDebugEvent += ScrapyCacheLogForDebug;
            ScrapyCachePool.LogInfoEvent  += ScrapyCacheLogForInfo;
            ScrapyCachePool.LogErrorEvent += ScrapyCacheLogForError;
            //客户端缓存配置表
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.基础组缓存表);
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.衍生品缓存表);
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.权益缓存表);
            cache.Get <ClientCacheConfigTable>().LoadDatas(appConfig.CacheLogConfig.固收缓存表);
            //客户端缓存列配置表
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.基础组缓存字段表);
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.衍生品缓存字段表);
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.权益缓存字段表);
            cache.Get <ClientCacheConfigColumnTable>().LoadDatas(appConfig.CacheLogConfig.固收缓存字段表);
            #endregion
        }