v9.7.2018.0421   支持运行时修改DAL连接字符串
大石头 authored at 2018-04-21 14:00:47
1.01 KiB
X
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NewLife.Log;
using NewLife.Net;
using NewLife.Queue.Center.Controllers;
using NewLife.Remoting;

namespace NewLife.Queue.Center
{
    /// <summary>
    /// 中心服务器
    /// </summary>
    public class CenterServer : ApiServer
    {
        public readonly Setting CurrentCfg = Setting.Current;
        public ClusterManager ClusterManager { get; }

        public string Demo => "My Info";
        /// <summary>
        /// 
        /// </summary>
        /// <param name="port"></param>
        public CenterServer(int port = 0)
        {
            if (port == 0) port = CurrentCfg.Port;
            Encoder = new JsonEncoder();
            if (CurrentCfg.Debug) Log = XTrace.Log;
            Add(new NetUri(NetType.Unknown, "", port));
            ClusterManager = new ClusterManager(this);
            //// Register<BrokerController>();
             Register<DemoController>();
        }
    }
}