示例#1
0
        protected override void OnStart(string[] args)
        {
            // start the service
            ILogger svcLogger = new ServiceLogger(base.EventLog);

            try
            {
                // - set current directory to the install location
                // - get executable name for file logger
                Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
                ProcessModule pm         = Process.GetCurrentProcess().MainModule;
                string        moduleName = pm.ModuleName.Split('.')[0];
                ILogger       logger     = new MultiLogger(svcLogger,
                                                           new FileLogger(@"C:\_qrsc\ServiceLogs\" + moduleName + ".{dddd}.log"));

                _ClientRef = Reference <ICoreClient> .Create(new CoreClientFactory(logger).Create());

                _Server              = new GridManagerServer();
                _Server.Logger       = logger;
                _Server.Client       = _ClientRef;
                _Server.HostInstance = null;
                _Server.Start();
            }
            catch (Exception ex)
            {
                svcLogger.Log(ex);
            }
        }
示例#2
0
        protected override void OnStart(string[] args)
        {
            // start the service
            ILogger svcLogger = new ServiceLogger(EventLog);

            try
            {
                // - set current directory to the install location
                // - get executable name for file logger
                Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
                ProcessModule       pm         = Process.GetCurrentProcess().MainModule;
                string              moduleName = pm.ModuleName.Split('.')[0];
                Reference <ILogger> loggerRef  = Reference <ILogger> .Create(new MultiLogger(
                                                                                 svcLogger,
                                                                                 new FileLogger(@"C:\_qds\logs\" + moduleName + ".{dddd}.log")));

                _clientRef = Reference <ICoreClient> .Create(new CoreClientFactory(loggerRef).SetEnv(BuildConst.BuildEnv).Create());

                _server = new AlertServer
                {
                    LoggerRef     = loggerRef,
                    Client        = _clientRef,
                    HostInstance  = null,
                    OtherSettings = _clientRef.Target.LoadAppSettings("AlertServer")
                };
                _server.Start();
            }
            catch (Exception ex)
            {
                svcLogger.Log(ex);
            }
        }
示例#3
0
 private void btnStartManager_Click(object sender, EventArgs e)
 {
     DisposeHelper.SafeDispose(ref _Manager);
     _Manager        = new GridManagerServer();
     _Manager.Logger = _ManagerLog;
     _Manager.Client = _ClientRef;
     _Manager.Start();
 }
示例#4
0
 private void btnStartWorkerB_Click(object sender, EventArgs e)
 {
     DisposeHelper.SafeDispose(ref _WorkerB);
     _WorkerB               = new GridWorkerServer();
     _WorkerB.Logger        = _WorkerBLog;
     _WorkerB.Client        = _ClientRef;
     _WorkerB.HostInstance  = "B";
     _WorkerB.OtherSettings = new NamedValueSet(new NamedValue(GridWorkerServer.Setting.HandlerLimit, 2));
     _WorkerB.Start();
 }
示例#5
0
        private void StartTheServer()
        {
            // start the service
            // - reset
            DisposeHelper.SafeDispose(ref _server);
            // - config
            var settings = new NamedValueSet();

            if (chkChangePort.Checked)
            {
                settings.Set(WFPropName.Port, Int32.Parse(txtChangePort.Text));
            }
            _server = new WorkflowServer {
                LoggerRef = _loggerRef, Client = _clientRef
            };
            // - start
            _server.Start();
        }
        protected override void OnStart(string[] args)
        {
            // start the service
            // - change the current directory to the service installation directory
            //   (required in order to access resource files)
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

            //_Logger = new ServiceLogger(base.EventLog);
            var logger = new FileLogger(@"C:\_qrsc\ServiceLogs\WorkflowEngineSvc.{dddd}.log");

            _logger = Reference <ILogger> .Create(logger);

            _clientRef = Reference <ICoreClient> .Create(new CoreClientFactory(_logger).Create());

            _server = new WorkflowServer {
                LoggerRef = _logger, Client = _clientRef
            };
            _server.Start();
        }
示例#7
0
        private void StartUp()
        {
            // stop server if already running
            CleanUp();
            // start the service
            var enabledProviders = (from int index in clbEnabledProviders.CheckedIndices select((MDSProviderId)index).ToString()).ToList();
            var settings         = new NamedValueSet();

            if (chkChangePort.Checked)
            {
                settings.Set(MdsPropName.Port, Int32.Parse(txtChangePort.Text));
            }
            settings.Set(MdsPropName.EnabledProviders, enabledProviders.ToArray());
            _clientRef = Reference <ICoreClient> .Create(new CoreClientFactory(_loggerRef).SetEnv(BuildConst.BuildEnv).Create());

            _server = new MarketDataServer {
                LoggerRef = _loggerRef, Client = _clientRef, OtherSettings = settings
            };
            _server.Start();
        }
示例#8
0
        private void BtnAlertSvrStartClick(object sender, EventArgs e)
        {
            // start the service
            using (Reference <ILogger> loggerRef = Reference <ILogger> .Create(new TextBoxLogger(txtAlertSvrLog)))
            {
                try
                {
                    Reference <ICoreClient> clientRef = Reference <ICoreClient> .Create(new CoreClientFactory(loggerRef).SetEnv(BuildConst.BuildEnv).Create());

                    _alertServer = new AlertServer
                    {
                        LoggerRef     = loggerRef,
                        Client        = clientRef,
                        HostInstance  = null,
                        OtherSettings = clientRef.Target.LoadAppSettings("AlertServer")
                    };
                    _alertServer.Start();
                }
                catch (Exception ex)
                {
                    loggerRef.Target.Log(ex);
                }
            }
        }