Example #1
0
        public void Run(
            Service.Cache cache,
            Service.Setting setting,
            Service.ConfigMgr configMgr,
            Service.Servers servers)
        {
            //external dependency injection
            coreCtrl = new CoreServerComponent.CoreCtrl(setting, configMgr);
            states   = new CoreServerComponent.CoreStates(servers, coreInfo);
            logger   = new CoreServerComponent.Logger(setting);
            configer = new CoreServerComponent.Configer(
                setting, cache, configMgr, servers, coreInfo);

            Plug(this, coreCtrl);
            Plug(this, states);
            Plug(this, logger);
            Plug(this, configer);

            //inter-container dependency injection
            coreCtrl.Prepare();
            states.Prepare();
            logger.Prepare();
            configer.Prepare();


            //other initializiations
            coreCtrl.BindEvents();
        }