Changeset 5055 for branches/HeuristicLab.Hive-3.4/sources
- Timestamp:
- 12/07/10 11:19:33 (14 years ago)
- 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 38 38 </PropertyGroup> 39 39 <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> 40 43 <Reference Include="HeuristicLab.Common-3.3"> 41 44 <HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Common-3.3.dll</HintPath> … … 58 61 </ItemGroup> 59 62 <ItemGroup> 63 <Compile Include="SlaveDummy.cs" /> 60 64 <None Include="HeuristicLabClientsHiveSlavePlugin.cs.frame" /> 61 65 <Compile Include="HeuristicLabClientsHiveSlavePlugin.cs" /> … … 65 69 <ItemGroup> 66 70 <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> 67 81 </ItemGroup> 68 82 <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 84 84 <Compile Include="Exceptions\OptimizerNotFoundException.cs" /> 85 85 <Compile Include="HiveExperiment\PluginClient.cs" /> 86 <Compile Include="IServiceLocator.cs" /> 86 87 <Compile Include="Jobs\OptimizerJob.cs" /> 87 88 <Compile Include="HeuristicLabClientsHivePlugin.cs" /> … … 96 97 <Compile Include="PersistenceUtil.cs" /> 97 98 <None Include="Properties\AssemblyInfo.cs.frame" /> 98 <Compile Include="ServiceClients\ServiceClientFactory.cs" />99 99 <Compile Include="Exceptions\ServiceClientFactoryException.cs" /> 100 100 <Compile Include="ServiceLocator.cs" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/HiveExperimentClient.cs
r5053 r5055 34 34 using HeuristicLab.Services.Hive.Common.DataTransfer; 35 35 using HeuristicLab.Clients.Hive.Jobs; 36 using HeuristicLab.Clients.Common; 36 37 37 38 /// <summary> … … 223 224 this.progress = new Progress("Connecting to server..."); 224 225 IsProgressing = true; 225 using (Disposable<IHiveService> service = ServiceLocator.Instance. ServicePool.GetService()) {226 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) { 226 227 IEnumerable<string> groups = ToResourceIdList(this.ResourceIds); 227 228 this.HiveJob.SetIndexInParentOptimizerList(null); … … 303 304 304 305 public void Stop() { 305 using (Disposable<IHiveService> service = ServiceLocator.Instance. ServicePool.GetService()) {306 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) { 306 307 foreach (HiveJob hj in HiveJob.GetAllHiveJobs()) { 307 308 service.Obj.StopJob(hj.Job.Id); … … 531 532 int jobCount = 0; 532 533 progress.Status = "Connecting to Server..."; 533 using (var service = ServiceLocator.Instance. ServicePool.GetService()) {534 using (var service = ServiceLocator.Instance.GetService()) { 534 535 // fetch all Job objects to create the full tree of tree of HiveJob objects 535 536 progress.Status = "Downloading list of jobs..."; … … 607 608 608 609 private OptimizerJob LoadOptimizerJob(Guid jobId) { 609 using (var service = ServiceLocator.Instance. ServicePool.GetService()) {610 using (var service = ServiceLocator.Instance.GetService()) { 610 611 JobData jobData = service.Obj.GetJobData(jobId); 611 612 try { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/HiveExperimentManagerClient.cs
r4905 r5055 32 32 using HeuristicLab.Common; 33 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 34 using HeuristicLab.Clients.Common; 34 35 35 36 [Item("Hive Client", "Connects to Hive and lists all submitted experiments by the current user.")] … … 96 97 this.HiveExperiments = new ItemList<HiveExperimentClient>(); 97 98 } 98 using (var service = ServiceLocator.Instance. ServicePool.GetService()) {99 using (var service = ServiceLocator.Instance.GetService()) { 99 100 currentlyUpdating = true; 100 101 IEnumerable<DT.HiveExperiment> response = service.Obj.GetHiveExperiments(); … … 138 139 void hiveExperiments_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<Collections.IndexedItem<HiveExperimentClient>> e) { 139 140 if (!currentlyUpdating) { 140 using (Disposable<IHiveService> service = ServiceLocator.Instance. ServicePool.GetService()) {141 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) { 141 142 foreach (IndexedItem<HiveExperimentClient> item in e.Items) { 142 143 if (item.Value.HiveExperimentId != Guid.Empty) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/HiveJobClient.cs
r5053 r5055 464 464 465 465 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()) { 467 467 IEnumerable<Plugin> availablePlugins = service.Obj.GetPlugins(); 468 468 foreach (IPluginDescription neededPlugin in neededPlugins) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/JobResultPoller.cs
r4629 r5055 27 27 using HeuristicLab.Services.Hive.Common.DataTransfer; 28 28 using System.Collections.Generic; 29 using HeuristicLab.Clients.Common; 29 30 30 31 namespace HeuristicLab.Clients.Hive { … … 95 96 96 97 private void FetchJobResults() { 97 using (Disposable<IHiveService> service = ServiceLocator.Instance. ServicePool.GetService()) {98 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) { 98 99 IEnumerable<LightweightJob> response = service.Obj.GetLightweightChildJobs(hiveJob.Job.Id, true, true); 99 100 OnJobResultsReceived(response); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveExperiment/PluginClient.cs
r4905 r5055 16 16 17 17 public void Load() { 18 using (var service = ServiceLocator.Instance. ServicePool.GetService()) {18 using (var service = ServiceLocator.Instance.GetService()) { 19 19 20 20 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs
r4905 r5055 22 22 using HeuristicLab.Services.Hive.Common.ServiceContracts; 23 23 using HeuristicLab.Clients.Hive.Properties; 24 using HeuristicLab.Clients.Common; 24 25 25 26 namespace 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 { 31 30 get { 32 31 if (instance == null) { … … 35 34 return instance; 36 35 } 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; 47 38 } 48 39 } 49 40 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"); 57 43 } 58 44 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/HeuristicLab.Services.Hive.Common-3.4.csproj
r5043 r5055 74 74 <Compile Include="DataTransfer\LightweightJob.cs" /> 75 75 <Compile Include="DataTransfer\JobState.cs" /> 76 <Compile Include="Disposable.cs" />77 76 <Compile Include="MessageContainer.cs" /> 78 77 <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 38 38 </PropertyGroup> 39 39 <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> 40 43 <Reference Include="HeuristicLab.Common-3.3"> 41 44 <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 6 6 using System.Transactions; 7 7 using HeuristicLab.Common; 8 using HeuristicLab.Clients.Common; 8 9 9 10 namespace HeuristicLab.Services.Hive.DataAccess { … … 12 13 TransactionScope transaction = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.IsolationLevelScope }); 13 14 var disposable = new Disposable<TransactionScope>(transaction); 14 disposable. Disposing += disposable_Disposing;15 disposable.OnDisposing += new EventHandler<EventArgs<object>>(disposable_OnDisposing); 15 16 return disposable; 16 17 } 17 18 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(); 21 23 } 22 24 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeuristicLab.Services.Hive-3.4.csproj
r5043 r5055 39 39 </PropertyGroup> 40 40 <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> 41 44 <Reference Include="HeuristicLab.Common-3.3"> 42 45 <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 10 10 using System.Data.Linq; 11 11 using HeuristicLab.Services.Hive.Common; 12 using System.Transactions; 12 13 13 14 namespace HeuristicLab.Services.Hive {
Note: See TracChangeset
for help on using the changeset viewer.