Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/07/10 11:19:33 (14 years ago)
Author:
cneumuel
Message:

#1233

  • added test project
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
9 added
2 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeuristicLab.Clients.Hive.Slave-3.4.csproj

    r5043 r5055  
    3838  </PropertyGroup>
    3939  <ItemGroup>
     40    <Reference Include="HeuristicLab.Clients.Common-3.3">
     41      <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Clients.Common-3.3.dll</HintPath>
     42    </Reference>
    4043    <Reference Include="HeuristicLab.Common-3.3">
    4144      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
     
    5861  </ItemGroup>
    5962  <ItemGroup>
     63    <Compile Include="SlaveDummy.cs" />
    6064    <None Include="HeuristicLabClientsHiveSlavePlugin.cs.frame" />
    6165    <Compile Include="HeuristicLabClientsHiveSlavePlugin.cs" />
     
    6569  <ItemGroup>
    6670    <None Include="HeuristicLab.snk" />
     71  </ItemGroup>
     72  <ItemGroup>
     73    <ProjectReference Include="..\..\HeuristicLab.Clients.Hive\3.4\HeuristicLab.Clients.Hive-3.4.csproj">
     74      <Project>{B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}</Project>
     75      <Name>HeuristicLab.Clients.Hive-3.4</Name>
     76    </ProjectReference>
     77    <ProjectReference Include="..\..\HeuristicLab.Services.Hive.Common\3.4\HeuristicLab.Services.Hive.Common-3.4.csproj">
     78      <Project>{14424A16-48D4-445E-80BF-DDF617548BBB}</Project>
     79      <Name>HeuristicLab.Services.Hive.Common-3.4</Name>
     80    </ProjectReference>
    6781  </ItemGroup>
    6882  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj

    r5043 r5055  
    8484    <Compile Include="Exceptions\OptimizerNotFoundException.cs" />
    8585    <Compile Include="HiveExperiment\PluginClient.cs" />
     86    <Compile Include="IServiceLocator.cs" />
    8687    <Compile Include="Jobs\OptimizerJob.cs" />
    8788    <Compile Include="HeuristicLabClientsHivePlugin.cs" />
     
    9697    <Compile Include="PersistenceUtil.cs" />
    9798    <None Include="Properties\AssemblyInfo.cs.frame" />
    98     <Compile Include="ServiceClients\ServiceClientFactory.cs" />
    9999    <Compile Include="Exceptions\ServiceClientFactoryException.cs" />
    100100    <Compile Include="ServiceLocator.cs" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/HiveExperimentClient.cs

    r5053 r5055  
    3434  using HeuristicLab.Services.Hive.Common.DataTransfer;
    3535  using HeuristicLab.Clients.Hive.Jobs;
     36  using HeuristicLab.Clients.Common;
    3637
    3738  /// <summary>
     
    223224        this.progress = new Progress("Connecting to server...");
    224225        IsProgressing = true;
    225         using (Disposable<IHiveService> service = ServiceLocator.Instance.ServicePool.GetService()) {
     226        using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
    226227          IEnumerable<string> groups = ToResourceIdList(this.ResourceIds);
    227228          this.HiveJob.SetIndexInParentOptimizerList(null);
     
    303304
    304305    public void Stop() {
    305       using (Disposable<IHiveService> service = ServiceLocator.Instance.ServicePool.GetService()) {
     306      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
    306307        foreach (HiveJob hj in HiveJob.GetAllHiveJobs()) {
    307308          service.Obj.StopJob(hj.Job.Id);
     
    531532        int jobCount = 0;
    532533        progress.Status = "Connecting to Server...";
    533         using (var service = ServiceLocator.Instance.ServicePool.GetService()) {
     534        using (var service = ServiceLocator.Instance.GetService()) {
    534535          // fetch all Job objects to create the full tree of tree of HiveJob objects
    535536          progress.Status = "Downloading list of jobs...";
     
    607608
    608609    private OptimizerJob LoadOptimizerJob(Guid jobId) {
    609       using (var service = ServiceLocator.Instance.ServicePool.GetService()) {
     610      using (var service = ServiceLocator.Instance.GetService()) {
    610611        JobData jobData = service.Obj.GetJobData(jobId);
    611612        try {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/HiveExperimentManagerClient.cs

    r4905 r5055  
    3232  using HeuristicLab.Common;
    3333  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     34  using HeuristicLab.Clients.Common;
    3435
    3536  [Item("Hive Client", "Connects to Hive and lists all submitted experiments by the current user.")]
     
    9697          this.HiveExperiments = new ItemList<HiveExperimentClient>();
    9798        }
    98         using (var service = ServiceLocator.Instance.ServicePool.GetService()) {
     99        using (var service = ServiceLocator.Instance.GetService()) {
    99100          currentlyUpdating = true;
    100101          IEnumerable<DT.HiveExperiment> response = service.Obj.GetHiveExperiments();
     
    138139    void hiveExperiments_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<HiveExperimentClient>> e) {
    139140      if (!currentlyUpdating) {
    140         using (Disposable<IHiveService> service = ServiceLocator.Instance.ServicePool.GetService()) {
     141        using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
    141142          foreach (IndexedItem<HiveExperimentClient> item in e.Items) {
    142143            if (item.Value.HiveExperimentId != Guid.Empty) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/HiveJobClient.cs

    r5053 r5055  
    464464     
    465465      IEnumerable<IPluginDescription> neededPlugins = ApplicationManager.Manager.Plugins; //HivePluginInfoDto.FindPluginsNeeded(optimizerJob.GetType());
    466       using (var service = ServiceLocator.Instance.ServicePool.GetService()) {
     466      using (var service = ServiceLocator.Instance.GetService()) {
    467467        IEnumerable<Plugin> availablePlugins = service.Obj.GetPlugins();
    468468        foreach (IPluginDescription neededPlugin in neededPlugins) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/JobResultPoller.cs

    r4629 r5055  
    2727using HeuristicLab.Services.Hive.Common.DataTransfer;
    2828using System.Collections.Generic;
     29using HeuristicLab.Clients.Common;
    2930
    3031namespace HeuristicLab.Clients.Hive {
     
    9596
    9697    private void FetchJobResults() {
    97       using (Disposable<IHiveService> service = ServiceLocator.Instance.ServicePool.GetService()) {
     98      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
    9899        IEnumerable<LightweightJob> response = service.Obj.GetLightweightChildJobs(hiveJob.Job.Id, true, true);
    99100        OnJobResultsReceived(response);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/PluginClient.cs

    r4905 r5055  
    1616
    1717    public void Load() {
    18       using (var service = ServiceLocator.Instance.ServicePool.GetService()) {
     18      using (var service = ServiceLocator.Instance.GetService()) {
    1919       
    2020      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs

    r4905 r5055  
    2222using HeuristicLab.Services.Hive.Common.ServiceContracts;
    2323using HeuristicLab.Clients.Hive.Properties;
     24using HeuristicLab.Clients.Common;
    2425
    2526namespace HeuristicLab.Clients.Hive {
    26   public class ServiceLocator {
    27     private static ServiceLocator instance = null;
    28     private ServiceClientFactory<IHiveService> serviceFactory = null;
    29 
    30     public static ServiceLocator Instance {
     27  public class ServiceLocator : IServiceLocator {
     28    private static IServiceLocator instance = null;
     29    public static IServiceLocator Instance {
    3130      get {
    3231        if (instance == null) {
     
    3534        return instance;
    3635      }
    37     }
    38 
    39     public ServiceLocator() {
    40       Settings.Default.SettingChanging += new System.Configuration.SettingChangingEventHandler(Default_SettingChanging);
    41     }
    42 
    43     private void Default_SettingChanging(object sender, System.Configuration.SettingChangingEventArgs e) {
    44       if (serviceFactory != null) {
    45         serviceFactory.Username = Settings.Default.HiveUsername;
    46         serviceFactory.Password = Settings.Default.HivePassword;
     36      set {
     37        instance = value;
    4738      }
    4839    }
    4940
    50     public ServiceClientFactory<IHiveService> ServicePool {
    51       get {
    52         if (serviceFactory == null) {
    53           serviceFactory = new ServiceClientFactory<IHiveService>(Settings.Default.HiveUsername, Settings.Default.HivePassword, "wsHttpBinding_IHiveService");
    54         }
    55         return serviceFactory;
    56       }
     41    public Disposable<IHiveService> GetService() {
     42        return ClientFactory.CreateClient<IHiveService>("wsHttpBinding_IHiveService");
    5743    }
    5844  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/HeuristicLab.Services.Hive.Common-3.4.csproj

    r5043 r5055  
    7474    <Compile Include="DataTransfer\LightweightJob.cs" />
    7575    <Compile Include="DataTransfer\JobState.cs" />
    76     <Compile Include="Disposable.cs" />
    7776    <Compile Include="MessageContainer.cs" />
    7877    <Compile Include="DataTransfer\NamedHiveItem.cs" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj

    r5043 r5055  
    3838  </PropertyGroup>
    3939  <ItemGroup>
     40    <Reference Include="HeuristicLab.Clients.Common-3.3">
     41      <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Clients.Common-3.3.dll</HintPath>
     42    </Reference>
    4043    <Reference Include="HeuristicLab.Common-3.3">
    4144      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/TransactionManager.cs

    r4796 r5055  
    66using System.Transactions;
    77using HeuristicLab.Common;
     8using HeuristicLab.Clients.Common;
    89
    910namespace HeuristicLab.Services.Hive.DataAccess {
     
    1213      TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.IsolationLevelScope });
    1314      var disposable = new Disposable<TransactionScope>(transaction);
    14       disposable.Disposing += disposable_Disposing;
     15      disposable.OnDisposing += new EventHandler<EventArgs<object>>(disposable_OnDisposing);
    1516      return disposable;
    1617    }
    1718
    18     void disposable_Disposing(object sender, EventArgs<TransactionScope> scope) {
    19       scope.Value.Complete();
    20       scope.Value.Dispose();
     19    void disposable_OnDisposing(object sender, EventArgs<object> e) {
     20      TransactionScope scope = (TransactionScope)e.Value;
     21      scope.Complete();
     22      scope.Dispose();
    2123    }
    2224  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeuristicLab.Services.Hive-3.4.csproj

    r5043 r5055  
    3939  </PropertyGroup>
    4040  <ItemGroup>
     41    <Reference Include="HeuristicLab.Clients.Common-3.3">
     42      <HintPath>..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Clients.Common-3.3.dll</HintPath>
     43    </Reference>
    4144    <Reference Include="HeuristicLab.Common-3.3">
    4245      <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs

    r5053 r5055  
    1010using System.Data.Linq;
    1111using HeuristicLab.Services.Hive.Common;
     12using System.Transactions;
    1213
    1314namespace HeuristicLab.Services.Hive {
Note: See TracChangeset for help on using the changeset viewer.