Ejemplo n.º 1
0
 private void HandleServiceException(string serviceName, ServiceStatusInfo serviceStatus)
 {
     ServiceController.Context.LogException(serviceStatus.Error);
     if (this.httpServiceHosts.ContainsKey(serviceName))
     {
         this.httpServiceHosts.Remove(serviceName);
     }
     throw serviceStatus.Error;
 }
Ejemplo n.º 2
0
        public static ServiceStatusInfo StopService(string serviceName)
        {
            ServiceStatusInfo serviceStatusInfo;

            lock (ServiceController.controllerLock)
            {
                ServiceStatusInfo serviceStatusInfo1 = ServiceManager.Instance.StopService(serviceName);
                ServiceController.ServiceStatusChanged(serviceStatusInfo1);
                serviceStatusInfo = serviceStatusInfo1;
            }
            return(serviceStatusInfo);
        }
Ejemplo n.º 3
0
        public ServiceStatusInfo GetServiceStatus(string serviceName, Exception ex)
        {
            ServiceStatusInfo serviceStatusInfo = new ServiceStatusInfo()
            {
                ServiceName = serviceName,
                Error       = ex
            };

            if (this.httpServiceHosts == null || !this.httpServiceHosts.ContainsKey(serviceName))
            {
                serviceStatusInfo.IsRunning       = false;
                serviceStatusInfo.ServiceEndpoint = StorageEmulatorConfigCache.Configuration.Services[serviceName].Url;
            }
            else
            {
                serviceStatusInfo.IsRunning       = this.httpServiceHosts[serviceName].IsRunning();
                serviceStatusInfo.ServiceEndpoint = this.httpServiceHosts[serviceName].UrlBase;
            }
            return(serviceStatusInfo);
        }
Ejemplo n.º 4
0
 private static void LogServiceStatusChange(ServiceStatusInfo status)
 {
     object[] serviceName = new object[] { status.ServiceName, status.ServiceEndpoint, status.IsRunning, status.Error };
     Console.WriteLine("Service Status: {0} {1} {2} {3}", serviceName);
 }