1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using HeuristicLab.Core;
|
---|
25 | using HeuristicLab.Common;
|
---|
26 |
|
---|
27 | namespace HeuristicLab.Hive {
|
---|
28 | public interface IJob : INamedItem {
|
---|
29 |
|
---|
30 | TimeSpan ExecutionTime { get; }
|
---|
31 |
|
---|
32 | ExecutionState ExecutionState { get; }
|
---|
33 |
|
---|
34 | /// <summary>
|
---|
35 | /// indicates wether it is possible to create childjobs from this job
|
---|
36 | /// </summary>
|
---|
37 | bool IsParallelizable { get; }
|
---|
38 |
|
---|
39 | /// <summary>
|
---|
40 | /// Configuration to indicate if this job should create child-jobs which will be executed in hive
|
---|
41 | /// Cannot be set true if IsParallelizable is false
|
---|
42 | /// </summary>
|
---|
43 | bool ComputeInParallel { get; set; }
|
---|
44 |
|
---|
45 | /// <summary>
|
---|
46 | /// If this is set to true, the job should be Resumed with the child-jobs attatched instead of Started
|
---|
47 | /// </summary>
|
---|
48 | bool CollectChildJobs { get; set; }
|
---|
49 |
|
---|
50 | void Prepare();
|
---|
51 |
|
---|
52 | void Start();
|
---|
53 |
|
---|
54 | void Pause();
|
---|
55 |
|
---|
56 | void Stop();
|
---|
57 |
|
---|
58 | void Resume(IEnumerable<IJob> childJobs);
|
---|
59 |
|
---|
60 | event EventHandler ComputeInParallelChanged;
|
---|
61 |
|
---|
62 | event EventHandler ExecutionTimeChanged;
|
---|
63 |
|
---|
64 | event EventHandler ExecutionStateChanged;
|
---|
65 |
|
---|
66 | event EventHandler JobFailed;
|
---|
67 |
|
---|
68 | event EventHandler JobStopped;
|
---|
69 |
|
---|
70 | /// <summary>
|
---|
71 | /// When this event occurs the job wants to sleep until all his child jobs are finished
|
---|
72 | /// </summary>
|
---|
73 | event EventHandler WaitForChildJobs;
|
---|
74 |
|
---|
75 | /// <summary>
|
---|
76 | /// This event will be fired when the job wants to have a child-job to be computed
|
---|
77 | /// </summary>
|
---|
78 | event EventHandler<EventArgs<IJob>> NewChildJob;
|
---|
79 |
|
---|
80 | /// <summary>
|
---|
81 | /// Will be fired when job wants all child-jobs to be deleted from hive
|
---|
82 | /// </summary>
|
---|
83 | event EventHandler DeleteChildJobs;
|
---|
84 |
|
---|
85 |
|
---|
86 | }
|
---|
87 | }
|
---|