Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/07/10 10:22:27 (14 years ago)
Author:
cneumuel
Message:
  • created HiveClient which shows an overview over all submitted HiveExperiments
  • its possible to download all submitted HiveExperiments including results
  • Experiments are now sent as a whole to the Hive and the Hive-Slaves take care of creating child-jobs (if necessary). The parent job is then paused and will be reactivated when all child-jobs are finished
  • WcfService-Clients are now consistently managed by WcfServicePool which allows to use IDisposable-Pattern and always keeps exactly one proxy-object until all callers disposed them.
  • created ProgressView which is able to lock a View and display progress of an action. It also allows to simulate progress if no progress-information is available so that users don't get too nervous while waiting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/ServiceLocator.cs

    r4337 r4368  
    2828using HeuristicLab.Hive.Contracts;
    2929using HeuristicLab.Hive.Experiment.Properties;
     30using HeuristicLab.Hive.Contracts.BusinessObjects;
     31using HeuristicLab.Hive.JobBase;
    3032
    3133namespace HeuristicLab.Hive.Experiment {
    3234  internal class ServiceLocator {
    33     internal static IClientFacade CreateClientFacade(string hostAddress) {
    34       ChannelFactory<IClientFacade> factory = new ChannelFactory<IClientFacade>("ClientHttpEndpoint");
    35       WcfSettings.SetEndpointAddress(factory.Endpoint, hostAddress);
     35    private static ServiceLocator instance = null;
     36    private WcfServicePool<IClientFacade> clientFacadePool = null;
     37    private WcfServicePool<IClientFacade> streamedClientFacadePool = null;
    3638
    37       factory.Credentials.UserName.UserName = Settings.Default.HiveUsername;
    38       factory.Credentials.UserName.Password = Settings.Default.HivePassword;
    39 
    40       IClientFacade client = factory.CreateChannel();
    41       return client;
     39    internal static ServiceLocator Instance {
     40      get {
     41        if (instance == null) {
     42          instance = new ServiceLocator();
     43        }
     44        return instance;
     45      }
    4246    }
    4347
    44     internal static IClientFacade CreateStreamedClientFacade(string hostAddress) {
    45       ChannelFactory<IClientFacade> factory = new ChannelFactory<IClientFacade>("ClientTcpStreamedEndpoint");
    46       WcfSettings.SetEndpointAddress(factory.Endpoint, hostAddress);
    47 
    48       factory.Credentials.UserName.UserName = Settings.Default.HiveUsername;
    49       factory.Credentials.UserName.Password = Settings.Default.HivePassword;
    50 
    51       IClientFacade client = factory.CreateChannel();
    52       return client;
     48    internal WcfServicePool<IClientFacade> ClientFacadePool {
     49      get {
     50        if (clientFacadePool == null) {
     51          clientFacadePool = new WcfServicePool<IClientFacade>(Settings.Default.HiveServerIp, Settings.Default.HiveUsername, Settings.Default.HivePassword, "ClientHttpEndpoint");
     52        }
     53        return clientFacadePool;
     54      }
    5355    }
    5456
    55     public static void DisposeClientFacade(IClientFacade clientFacade) {
    56       WcfSettings.DisposeWcfClient((ICommunicationObject)clientFacade);     
     57    internal WcfServicePool<IClientFacade> StreamedClientFacadePool {
     58      get {
     59        if (streamedClientFacadePool == null) {
     60          streamedClientFacadePool = new WcfServicePool<IClientFacade>(Settings.Default.HiveServerIp, Settings.Default.HiveUsername, Settings.Default.HivePassword, "ClientTcpStreamedEndpoint");
     61        }
     62        return streamedClientFacadePool;
     63      }
    5764    }
    5865  }
Note: See TracChangeset for help on using the changeset viewer.