Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/11 18:58:53 (13 years ago)
Author:
cneumuel
Message:

#1233

  • created baseclass for jobs (ItemJob) which derives OperatorJobs and EngineJobs
  • created special view for OptimizerJobs which derives from a more general view
  • removed logic from domain class HiveExperiment and moved it into RefreshableHiveExperiment
  • improved ItemTreeView
  • corrected plugin dependencies
  • fixed bug in database trigger when deleting HiveExperiments
  • added delete cascade for Plugin and PluginData
  • lots of fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/EngineJob.cs

    r6000 r6033  
    99namespace HeuristicLab.HiveEngine {
    1010  [StorableClass]
    11   public class EngineJob : AbstractJob {
    12     [Storable]
    13     private IEngine engine;
    14 
     11  public class EngineJob : ItemJob {
    1512    [Storable]
    1613    protected IOperation initialOperation;
     
    2017    }
    2118
     19    public new IEngine Item {
     20      get { return (IEngine)base.Item; }
     21      set { base.Item = value; }
     22    }
     23
    2224    public override TimeSpan ExecutionTime {
    23       get { return engine.ExecutionTime; }
     25      get { return Item.ExecutionTime; }
    2426    }
    2527
    2628    public override ExecutionState ExecutionState {
    27       get { return engine.ExecutionState; }
     29      get { return Item.ExecutionState; }
    2830    }
    2931
     
    3234    public EngineJob(IOperation initialOperation, IEngine engine) {
    3335      this.initialOperation = initialOperation;
    34       this.engine = engine;
    35       RegisterEngineEvents();
     36      this.Item = engine;
    3637    }
    3738
     
    4041    protected EngineJob(EngineJob original, Cloner cloner)
    4142      : base(original, cloner) {
    42       this.engine = cloner.Clone(original.engine);
    4343      this.initialOperation = cloner.Clone(original.initialOperation);
    44       RegisterEngineEvents();
    4544    }
    4645    public override IDeepCloneable Clone(Cloner cloner) {
    4746      return new EngineJob(this, cloner);
    48     }
    49     [StorableHook(HookType.AfterDeserialization)]
    50     private void AfterDeserialization() {
    51       RegisterEngineEvents();
    5247    }
    5348    #endregion
     
    6055
    6156    public override void Start() {
    62       engine.Prepare(initialOperation);
    63       engine.Start();
     57      Item.Prepare(initialOperation);
     58      Item.Start();
    6459    }
    6560   
    6661    public override void Pause() {
    67       engine.Pause();
     62      Item.Pause();
    6863    }
    6964
    7065    public override void Stop() {
    71       engine.Stop();
     66      Item.Stop();
    7267    }
    7368   
     
    7671    }
    7772
    78     private void RegisterEngineEvents() {
    79       engine.Stopped += new EventHandler(engine_Stopped);
    80       engine.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred);
     73    protected override void RegisterItemEvents() {
     74      Item.Stopped += new EventHandler(engine_Stopped);
     75      Item.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred);
     76    }
     77
     78    protected override void DeregisterItemEvents() {
     79      Item.Stopped -= new EventHandler(engine_Stopped);
     80      Item.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred);
    8181    }
    8282
     
    103103
    104104    public override string Name {
    105       get { return engine.ToString(); }
     105      get { return Item.ToString(); }
    106106      set { throw new NotSupportedException(); }
    107107    }
Note: See TracChangeset for help on using the changeset viewer.