コード例 #1
0
ファイル: ControllerService.cs プロジェクト: virajs/monoscape
 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;
     }
 }
コード例 #2
0
ファイル: ControllerService.cs プロジェクト: virajs/monoscape
 private void StartApplicationService()
 {
     try
     {
         applicationHost = MonoscapeServiceHost.CreateHost(typeof(ApplicationService));
         var binding = MonoscapeServiceHost.GetBinding();
         applicationHost.AddServiceEndpoint(typeof(IApplicationService), binding, Settings.ApplicationServiceURL);
         applicationHost.Open();
         Console.WriteLine("Application service started at: " + Settings.ApplicationServiceURL);
     }
     catch (CommunicationException ex)
     {
         if (applicationHost != null)
         {
             applicationHost.Abort();
         }
         throw new MonoscapeException("Could not start service host: ApplicationService", ex);
     }
     catch (TimeoutException ex)
     {
         if (applicationHost != null)
         {
             applicationHost.Abort();
         }
         throw new MonoscapeException("Could not start service host: ApplicationService", ex);
     }
     catch (Exception)
     {
         if (applicationHost != null)
         {
             applicationHost.Abort();
         }
         throw;
     }
 }
コード例 #3
0
ファイル: ControllerService.cs プロジェクト: virajs/monoscape
 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 StartApplicationGridService()
 {
     try
     {
         if (gridServiceHost == null)
         {
             gridServiceHost = MonoscapeServiceHost.CreateHost(typeof(LbApplicationGridService));
             var binding = MonoscapeServiceHost.GetBinding();
             gridServiceHost.AddServiceEndpoint(typeof(ILbApplicationGridService), binding, Settings.LbApplicationGridServiceURL);
             gridServiceHost.Open();
             Console.WriteLine("Application Grid service started at: " + Settings.LbApplicationGridServiceURL);
         }
     }
     catch (AddressAlreadyInUseException)
     {
     }
     catch (CommunicationException ex)
     {
         if (gridServiceHost != null)
         {
             gridServiceHost.Abort();
         }
         throw new MonoscapeException("Could not start service host: LbApplicationGridService", ex);
     }
     catch (TimeoutException ex)
     {
         if (gridServiceHost != null)
         {
             gridServiceHost.Abort();
         }
         throw new MonoscapeException("Could not start service host: LbApplicationGridService", ex);
     }
     catch (Exception)
     {
         if (gridServiceHost != null)
         {
             gridServiceHost.Abort();
         }
         throw;
     }
 }