Beispiel #1
0
 /// <summary>
 /// 默认构造函数,仅允许初始化一次
 /// </summary>
 public ServiceStatus(MicroServiceBase service)
 {
     this.statusDict = new ConcurrentDictionary <string, dynamic>
     {
         [KEY_START_TIME]   = DateTime.Now,
         [KEY_SERVICE_URLS] = service.RunningUrls,
         [KEY_SERVICE_NAME] = service.ServiceName,
         [KEY_RUN_MODE]     = service.ServiceRunningMode.ToString(),
         [KEY_HEALTH_URL]   = service.HealthUrl
     };
 }
Beispiel #2
0
 public CustomBootstrapper(
     MicroServiceBase service,
     IEnumerable <ModuleRegistration> modules,
     Action <MicroServiceBase, TinyIoCContainer> prepareBeforeRun,
     Action <MicroServiceBase, IPipelines, NancyContext> processPipelines,
     bool useCors)
 {
     this.service          = service;
     this.modules          = modules;
     this.prepareBeforeRun = prepareBeforeRun;
     this.useCors          = useCors;
     this.processPipelines = processPipelines;
 }
Beispiel #3
0
 /// <summary>
 /// 在子类中重写时,可处理 Nancy Pipelines 完成扩展功能
 /// </summary>
 /// <param name="service"></param>
 /// <param name="pipelines"></param>
 /// <param name="nancyContext"></param>
 protected virtual void RequestStartDefaultAction(
     MicroServiceBase service,
     IPipelines pipelines,
     NancyContext nancyContext)
 {
 }
Beispiel #4
0
 /// <summary>
 /// 更新服务状态时执行的事件,可以通过此事件,向 /health 接口汇报服务状态
 /// </summary>
 protected virtual void ServiceStatusUpdateDefaultAction(
     MicroServiceBase service,
     ServiceStatus status)
 {
 }
Beispiel #5
0
 /// <summary>
 /// 服务停止后执行的事件
 /// </summary>
 protected virtual void ServiceStopedDefaultAction(
     MicroServiceBase service)
 {
 }
Beispiel #6
0
 /// <summary>
 /// 服务启动之前执行的事件
 /// </summary>
 protected virtual void ServiceStartingDefaultAction(
     MicroServiceBase service,
     TinyIoCContainer container)
 {
 }