Changeset 5399 for branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3
- Timestamp:
- 01/31/11 10:35:57 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/HiveExperimentList.cs
r4760 r5399 26 26 27 27 namespace HeuristicLab.Hive.ExperimentManager { 28 [Item("HiveExperiment List", "Represents a list of hive experiments.")]28 [Item("HiveExperiment Collection", "Represents a list of hive experiments.")] 29 29 [StorableClass] 30 public class HiveExperiment List : ItemList<HiveExperiment> {31 public HiveExperiment List() : base() { }32 public HiveExperiment List(int capacity) : base(capacity) { }33 public HiveExperiment List(IEnumerable<HiveExperiment> collection) : base(collection) { }30 public class HiveExperimentCollection : ItemCollection<HiveExperiment> { 31 public HiveExperimentCollection() : base() { } 32 public HiveExperimentCollection(int capacity) : base(capacity) { } 33 public HiveExperimentCollection(IEnumerable<HiveExperiment> collection) : base(collection) { } 34 34 35 35 [StorableConstructor] 36 protected HiveExperiment List(bool deserializing) : base(deserializing) { }37 protected HiveExperiment List(HiveExperimentListoriginal, Cloner cloner)36 protected HiveExperimentCollection(bool deserializing) : base(deserializing) { } 37 protected HiveExperimentCollection(HiveExperimentCollection original, Cloner cloner) 38 38 : base(original, cloner) { 39 39 } 40 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new HiveExperiment List(this, cloner);41 return new HiveExperimentCollection(this, cloner); 42 42 } 43 43 } -
branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/HiveExperimentManager.cs
r4914 r5399 42 42 } 43 43 44 private HiveExperiment ListhiveExperiments;45 public HiveExperiment ListHiveExperiments {44 private HiveExperimentCollection hiveExperiments; 45 public HiveExperimentCollection HiveExperiments { 46 46 get { return hiveExperiments; } 47 47 set { … … 73 73 private void RegisterHiveExperimentsEvent() { 74 74 if (hiveExperiments != null) { 75 hiveExperiments.ItemsRemoved += new CollectionItemsChangedEventHandler< IndexedItem<HiveExperiment>>(hiveExperiments_ItemsRemoved);75 hiveExperiments.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveExperiment>(hiveExperiments_ItemsRemoved); 76 76 } 77 77 } … … 79 79 private void DeRegisterHiveExperimentsEvents() { 80 80 if (hiveExperiments != null) { 81 hiveExperiments.ItemsRemoved -= new CollectionItemsChangedEventHandler< IndexedItem<HiveExperiment>>(hiveExperiments_ItemsRemoved);81 hiveExperiments.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveExperiment>(hiveExperiments_ItemsRemoved); 82 82 } 83 83 } … … 100 100 IsProgressing = true; 101 101 if (this.HiveExperiments == null) { 102 this.HiveExperiments = new HiveExperiment List();102 this.HiveExperiments = new HiveExperimentCollection(); 103 103 } 104 104 using (Disposable<IClientFacade> service = ServiceLocator.Instance.ClientFacadePool.GetService()) { … … 149 149 } 150 150 151 void hiveExperiments_ItemsRemoved(object sender, Collection s.CollectionItemsChangedEventArgs<Collections.IndexedItem<HiveExperiment>> e) {151 void hiveExperiments_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<HiveExperiment> e) { 152 152 if (!currentlyUpdating) { 153 153 using (Disposable<IClientFacade> service = ServiceLocator.Instance.ClientFacadePool.GetService()) { 154 foreach ( IndexedItem<HiveExperiment>item in e.Items) {155 if (item. Value.HiveExperimentId != Guid.Empty) {156 service.Obj.DeleteHiveExperiment(item. Value.HiveExperimentId);154 foreach (HiveExperiment item in e.Items) { 155 if (item.HiveExperimentId != Guid.Empty) { 156 service.Obj.DeleteHiveExperiment(item.HiveExperimentId); 157 157 } 158 158 } -
branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/JobResultPoller.cs
r4914 r5399 92 92 catch (Exception e) { 93 93 OnExceptionOccured(e); 94 IsPolling = false; 94 95 } 95 96 } 96 97 97 98 private void FetchJobResults() { 98 ResponseObject<JobResultList> response; 99 using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) { 100 response = service.Obj.GetChildJobResults(hiveJob.JobDto.Id, true, true); 99 int repetitions = 5; 100 ResponseObject<JobResultList> response = null; 101 while (response == null && repetitions > 0) { 102 repetitions--; 103 try { 104 using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) { 105 response = service.Obj.GetChildJobResults(hiveJob.JobDto.Id, true, true); 106 } 107 } 108 catch (Exception e) { 109 if (repetitions == 0) 110 throw e; 111 } 101 112 } 102 113 if (response.StatusMessage == ResponseStatus.Ok) {
Note: See TracChangeset
for help on using the changeset viewer.