/// <summary> /// 初始化 /// </summary> protected Configuration() { _config = this; //心跳参数不宜过短 this.Interval = 10000; this.Wait = 1000; this.SelfHosting = true; }
/// <summary> /// 初始化 /// </summary> /// <param name="config"></param> protected Configuration(Configuration config) : this() { this.AssociateUri = config.AssociateUri; this.AsyncReceiverUri = config.AsyncReceiverUri; this.Container = config.Container; this.ID = config.ID; this.Interval = config.Interval; this.Wait = config.Wait; this.SelfHosting = config.SelfHosting; this.SetUri(config.Uri); }
/// <summary> /// 卸载当前服务节点实例 /// </summary> public static void Cleanup() { _config = null; _endpoint = null; //TODO:需要卸载各类静态实例和remoting等监听 }
/// <summary> /// 初始化服务节点配置 /// </summary> /// <returns></returns> public static Configuration Configure() { if (_config != null) throw new InvalidOperationException("不能重复初始化"); var config = new Configuration(); return config; }
/// <summary> /// 初始化 /// </summary> /// <param name="config"></param> public ConfigurationWithDefault(Configuration config) : base(config) { }