Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/17 17:19:35 (7 years ago)
Author:
gkronber
Message:

#2520: changed all usages of StorableClass to use StorableType with an auto-generated GUID (did not add StorableType to other type definitions yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceReintegration/HeuristicLab.Clients.Hive/3.3/HiveTasks/HiveTask.cs

    r14185 r14927  
    2929using HeuristicLab.Common;
    3030using HeuristicLab.Core;
    31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HeuristicLab.Persistence;
    3232using HeuristicLab.PluginInfrastructure;
    3333
     
    3535
    3636  [Item("Hive Task", "Represents a hive task.")]
    37   [StorableClass]
     37  [StorableType("0bf8fae8-e53b-4eed-a29a-fd73d8eaad6e")]
    3838  public class HiveTask : NamedItem, IItemTree<HiveTask>, IDisposable {
    3939    protected static object locker = new object();
     
    8787          try {
    8888            childHiveTasks.Clear();
    89           }
    90           finally { childHiveTasksLock.ExitWriteLock(); }
     89          } finally { childHiveTasksLock.ExitWriteLock(); }
    9190        }
    9291        if (itemTask != value) {
     
    9695            itemTask = value;
    9796            RegisterItemTaskEvents();
    98           }
    99           finally { itemTaskLock.ExitWriteLock(); }
     97          } finally { itemTaskLock.ExitWriteLock(); }
    10098          OnItemTaskChanged();
    10199          IsFinishedTaskDownloaded = true;
     
    133131              hiveJob.IsControllable = value;
    134132            }
    135           }
    136           finally {
     133          } finally {
    137134            childHiveTasksLock.ExitReadLock();
    138135          }
     
    148145        try {
    149146          return childHiveTasks.AsReadOnly();
    150         }
    151         finally { childHiveTasksLock.ExitReadLock(); }
     147        } finally { childHiveTasksLock.ExitReadLock(); }
    152148      }
    153149    }
     
    194190      try {
    195191        this.ItemTask = PersistenceUtil.Deserialize<ItemTask>(taskData.Data);
    196       }
    197       catch {
     192      } catch {
    198193        this.ItemTask = null;
    199194      }
     
    210205      try {
    211206        this.childHiveTasks = cloner.Clone(original.childHiveTasks);
    212       }
    213       finally { original.childHiveTasksLock.ExitReadLock(); }
     207      } finally { original.childHiveTasksLock.ExitReadLock(); }
    214208      this.syncTasksWithOptimizers = original.syncTasksWithOptimizers;
    215209      this.isFinishedTaskDownloaded = original.isFinishedTaskDownloaded;
     
    260254      try {
    261255        this.childHiveTasks.Add(hiveTask);
    262       }
    263       finally { childHiveTasksLock.ExitWriteLock(); }
     256      } finally { childHiveTasksLock.ExitWriteLock(); }
    264257    }
    265258
     
    379372        }
    380373        return tasks;
    381       }
    382       finally { childHiveTasksLock.ExitReadLock(); }
     374      } finally { childHiveTasksLock.ExitReadLock(); }
    383375    }
    384376
     
    394386        }
    395387        return null;
    396       }
    397       finally { childHiveTasksLock.ExitWriteLock(); }
     388      } finally { childHiveTasksLock.ExitWriteLock(); }
    398389    }
    399390
     
    412403              return result;
    413404          }
    414         }
    415         finally { childHiveTasksLock.ExitReadLock(); }
     405        } finally { childHiveTasksLock.ExitReadLock(); }
    416406      }
    417407      return null;
     
    428418          child.RemoveByTaskId(taskId);
    429419        }
    430       }
    431       finally { childHiveTasksLock.ExitWriteLock(); }
     420      } finally { childHiveTasksLock.ExitWriteLock(); }
    432421    }
    433422
     
    482471            HiveServiceLocator.Instance.CallHiveService(s => s.PauseTask(child.task.Id));
    483472          }
    484         }
    485         finally { childHiveTasksLock.ExitReadLock(); }
     473        } finally { childHiveTasksLock.ExitReadLock(); }
    486474      } else {
    487475        HiveServiceLocator.Instance.CallHiveService(s => s.PauseTask(this.task.Id));
     
    496484            HiveServiceLocator.Instance.CallHiveService(s => s.StopTask(child.task.Id));
    497485          }
    498         }
    499         finally { childHiveTasksLock.ExitReadLock(); }
     486        } finally { childHiveTasksLock.ExitReadLock(); }
    500487      } else {
    501488        HiveServiceLocator.Instance.CallHiveService(s => s.StopTask(this.task.Id));
     
    541528
    542529  [Item("Hive Task", "Represents a hive task.")]
    543   [StorableClass]
     530  [StorableType("ca112124-bb35-42fa-b2b7-e6367980eb8c")]
    544531  public class HiveTask<T> : HiveTask where T : ItemTask {
    545532
Note: See TracChangeset for help on using the changeset viewer.