Пример #1
0
 private void StartNodeControllerService()
 {
     try
     {
         nodeControllerHost = MonoscapeServiceHost.CreateHost(typeof(ApNodeControllerService));
         var binding = MonoscapeServiceHost.GetBinding();
         nodeControllerHost.AddServiceEndpoint(typeof(IApNodeControllerService), binding, Settings.NodeControllerServiceURL);
         nodeControllerHost.Open();
         Console.WriteLine("Node Controller service started at: " + Settings.NodeControllerServiceURL);
     }
     catch (CommunicationException ex)
     {
         if (nodeControllerHost != null)
             nodeControllerHost.Abort();
         throw new MonoscapeException("Could not start service host: ApNodeControllerService", ex);
     }
     catch (TimeoutException ex)
     {
         if (nodeControllerHost != null)
             nodeControllerHost.Abort();
         throw new MonoscapeException("Could not start service host: ApNodeControllerService", ex);
     }
     catch (Exception)
     {
         if (nodeControllerHost != null)
             nodeControllerHost.Abort();
         throw;
     }
 }
Пример #2
0
 private void StartApplicationGridService()
 {
     try
     {
         gridHost = MonoscapeServiceHost.CreateHost(typeof(NcApplicationGridService));
         var binding = MonoscapeServiceHost.GetBinding();
         gridHost.AddServiceEndpoint(typeof(INcApplicationGridService), binding, Settings.ApplicationGridServiceUrl);
         gridHost.Open();
         Console.WriteLine("Application Grid service started at: " + Settings.ApplicationGridServiceUrl);
     }
     catch (CommunicationException ex)
     {
         if (gridHost != null)
             gridHost.Abort();
         throw new MonoscapeException("Could not start service host: NcApplicationGridService", ex);
     }
     catch (TimeoutException ex)
     {
         if (gridHost != null)
             gridHost.Abort();
         throw new MonoscapeException("Could not start service host: NcApplicationGridService", ex);
     }
     catch (Exception e)
     {
         if (gridHost != null)
             gridHost.Abort();
         throw e;
     }
 }
Пример #3
0
 private void StartExternalSystemService()
 {
     try
     {
         externalSysHost = MonoscapeServiceHost.CreateHost(typeof(ExternalSystemService));
         var binding = MonoscapeServiceHost.GetBinding();
         externalSysHost.AddServiceEndpoint(typeof(IExternalSystemService), binding, Settings.ExternalSystemServiceURL);
         externalSysHost.Open();
         Console.WriteLine("External system service started at: " + Settings.ExternalSystemServiceURL);
     }
     catch (CommunicationException ex)
     {
         if (externalSysHost != null)
             externalSysHost.Abort();
         throw new MonoscapeException("Could not start service host: ExternalSystemService", ex);
     }
     catch (TimeoutException ex)
     {
         if (externalSysHost != null)
             externalSysHost.Abort();
         throw new MonoscapeException("Could not start service host: ExternalSystemService", ex);
     }
     catch (Exception)
     {
         if (externalSysHost != null)
             externalSysHost.Abort();
         throw;
     }
 }
Пример #4
0
 private void StartLoadBalancerWebService()
 {
     try
     {
         if (loadBalancerWebServiceHost == null)
         {
             loadBalancerWebServiceHost = MonoscapeServiceHost.CreateHost(typeof(LbLoadBalancerWebService));
             var binding = MonoscapeServiceHost.GetBinding();
             loadBalancerWebServiceHost.AddServiceEndpoint(typeof(ILbLoadBalancerWebService), binding, Settings.LbLoadBalancerWebServiceURL);
             loadBalancerWebServiceHost.Open();
             Console.WriteLine("Load Balancer Web service started at: " + Settings.LbLoadBalancerWebServiceURL);
         }
     }
     catch (AddressAlreadyInUseException)
     {
     }
     catch (CommunicationException ex)
     {
         if (loadBalancerWebServiceHost != null)
             loadBalancerWebServiceHost.Abort();
         throw new MonoscapeException("Could not start service host: LbApplicationGridService", ex);
     }
     catch (TimeoutException ex)
     {
         if (loadBalancerWebServiceHost != null)
             loadBalancerWebServiceHost.Abort();
         throw new MonoscapeException("Could not start service host: LbApplicationGridService", ex);
     }
     catch (Exception)
     {
         if (loadBalancerWebServiceHost != null)
             loadBalancerWebServiceHost.Abort();
         throw;
     }
 }
Пример #5
0
 private void StartDashboardService()
 {
     try
     {
         dashboardHost = MonoscapeServiceHost.CreateHost(typeof(CcDashboardService));
         var binding = MonoscapeServiceHost.GetBinding();
         dashboardHost.AddServiceEndpoint(typeof(ICcDashboardService), binding, Settings.DashboardServiceURL);
         dashboardHost.Open();
         Console.WriteLine("Dashboard service started at: " + Settings.DashboardServiceURL);
     }
     catch (CommunicationException ex)
     {
         if (dashboardHost != null)
             dashboardHost.Abort();
         throw new MonoscapeException("Could not start service host: CcDashboardService", ex);
     }
     catch (TimeoutException ex)
     {
         if (dashboardHost != null)
             dashboardHost.Abort();
         throw new MonoscapeException("Could not start service host: CcDashboardService", ex);
     }
     catch (Exception)
     {
         if (dashboardHost != null)
             dashboardHost.Abort();
         throw;
     }
 }