Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.Console/3.2/ServiceLocator.cs @ 1679

Last change on this file since 1679 was 1579, checked in by mbecirov, 16 years ago

#528: WCF Service secured - you need to install the certificate in order to run the application properly!

File size: 1.3 KB
RevLine 
[799]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6using HeuristicLab.Hive.Contracts.Interfaces;
7using System.ServiceModel;
[1579]8using HeuristicLab.Hive.Contracts;
[799]9
[1089]10namespace HeuristicLab.Hive.Server.ServerConsole {
[799]11  internal class ServiceLocator {
[1084]12    private static IServerConsoleFacade serverConsoleFacade = null;
[799]13
14    internal static string Address { get; set; }
15    internal static string Port { get; set; }
16
17    internal static IClientManager GetClientManager() {
[1084]18      return GetServerConsoleFacade() as IClientManager;
[799]19    }
20
21    internal static IJobManager GetJobManager() {
[1084]22      return GetServerConsoleFacade() as IJobManager;
23    }
[799]24
[1084]25    internal static IServerConsoleFacade GetServerConsoleFacade() {
26      if (serverConsoleFacade == null &&
[799]27        Address != String.Empty &&
28        Port != String.Empty) {
[1136]29
[1579]30        //binding.MaxReceivedMessageSize = 5000000;
[1136]31
[1084]32        ChannelFactory<IServerConsoleFacade> factory =
33          new ChannelFactory<IServerConsoleFacade>(
[1579]34            WcfSettings.GetBinding(),
[1084]35            new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/ServerConsoleFacade"));
[799]36
[1084]37        serverConsoleFacade = factory.CreateChannel();
[799]38      }
39
[1084]40      return serverConsoleFacade;
[799]41    }
42  }
43}
Note: See TracBrowser for help on using the repository browser.