Beispiel #1
0
 /// <summary>
 ///     初始化属于指定服务角色的系统工作者
 /// </summary>
 /// <param name="role">服务角色</param>
 /// <param name="setting">远程配置设置</param>
 /// <param name="configurationProxy">远程配置站访问代理器</param>
 /// <param name="notificationHandler">异常通知处理器</param>
 /// <param name="proxy">KAE资源代理器</param>
 /// <exception cref="ArgumentNullException">参数不能为空</exception>
 public static void Initialize(string role, RemoteConfigurationSetting setting, IRemoteConfigurationProxy configurationProxy, ITracingNotificationHandler notificationHandler = null, IKAEResourceProxy proxy = null)
 {
     if (IsInitialized)
     {
         return;
     }
     if (setting == null)
     {
         setting = RemoteConfigurationSetting.Default;
     }
     if (proxy == null)
     {
         proxy = new KAEHostResourceProxy();
     }
     if (string.IsNullOrEmpty(role))
     {
         throw new ArgumentNullException(nameof(role));
     }
     if (configurationProxy == null)
     {
         throw new ArgumentNullException(nameof(configurationProxy));
     }
     SystemConfigurations.Initialize(role, setting, configurationProxy);
     _tracing = TracingManager.GetTracing(typeof(SystemWorker));;
     TransactionGlobal.Initialize();
     _configurationProxy = configurationProxy;
     _hostProxy          = proxy;
     TracingManager.NotificationHandler = notificationHandler ?? new RemoteLogProxy();
     InitializeCore(role);
     //initialize long...long memory buffer for tcp layer.
     ChannelConst.Initialize();
     _isInitialized   = true;
     IsInSpecifiedKPP = false;
 }
Beispiel #2
0
 /// <summary>
 ///     为KPP专门设计的初始化SystemWorker的函数
 /// </summary>
 /// <param name="role">服务角色</param>
 /// <param name="proxy">KAE资源代理器</param>
 /// <param name="settings">KJFramework网络层设置集</param>
 /// <param name="appUniqueId">APP唯一编号</param>
 /// <exception cref="ArgumentNullException">参数不能为空</exception>
 internal static void InitializeForKPP(string role, IKAEResourceProxy proxy, ChannelInternalConfigSettings settings, Guid appUniqueId)
 {
     if (IsInitialized)
     {
         return;
     }
     if (string.IsNullOrEmpty(role))
     {
         throw new ArgumentNullException(nameof(role));
     }
     _hostProxy          = proxy;
     _appUniqueId        = appUniqueId;
     _configurationProxy = new KPPConfigurationProxy(proxy);
     SystemConfigurations.Initialize(role, RemoteConfigurationSetting.Default, _configurationProxy);
     _tracing = TracingManager.GetTracing(typeof(SystemWorker));;
     TransactionGlobal.Initialize();
     //Regist("LGS", new LGSProtocolStack());
     TracingManager.NotificationHandler = new RemoteLogProxy();
     InitializeCore(role);
     //initialize long...long memory buffer for tcp layer.
     ChannelConst.Initialize(settings);
     _isInitialized   = true;
     IsInSpecifiedKPP = true;
 }