Changeset 2735
- Timestamp:
- 6/29/2012 7:40:44 AM (11 months ago)
- Location:
- branches/eraser6/EraserService
- Files:
-
- 6 edited
-
Eraser.Manager/DirectExecutor.cs (modified) (1 diff)
-
Eraser.Manager/Eraser.Manager.csproj (modified) (1 diff)
-
Eraser.Manager/Executor.cs (modified) (8 diffs)
-
Eraser.Manager/RemoteExecutor.cs (modified) (1 diff)
-
Eraser.Manager/Task.cs (modified) (2 diffs)
-
Eraser/Program.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/EraserService/Eraser.Manager/DirectExecutor.cs
r2624 r2735 532 532 } 533 533 534 private new DirectExecutor Owner535 {536 get537 {538 return (DirectExecutor)base.Owner;539 }540 }541 542 534 /// <summary> 543 535 /// The data store for this object. -
branches/eraser6/EraserService/Eraser.Manager/Eraser.Manager.csproj
r2624 r2735 61 61 <Reference Include="System.Drawing" /> 62 62 <Reference Include="System.Security" /> 63 <Reference Include="System.ServiceModel" />64 63 <Reference Include="System.Windows.Forms" /> 65 64 <Reference Include="System.Xml" /> -
branches/eraser6/EraserService/Eraser.Manager/Executor.cs
r2624 r2735 24 24 using System.Text; 25 25 using System.IO; 26 27 using System.ServiceModel;28 26 29 27 namespace Eraser.Manager … … 34 32 /// abstract as they each will have their own ways of dealing with tasks. 35 33 /// </summary> 36 [ServiceContract(Namespace="http://eraser.sourceforge.net/", SessionMode=SessionMode.Required)] 37 public interface IExecutor : IDisposable 34 public abstract class Executor : IDisposable 38 35 { 36 #region IDisposable members 37 ~Executor() 38 { 39 Dispose(false); 40 } 41 42 protected virtual void Dispose(bool disposing) 43 { 44 } 45 46 public void Dispose() 47 { 48 Dispose(true); 49 GC.SuppressFinalize(this); 50 } 51 #endregion 52 53 /// <summary> 54 /// Starts the execution of tasks queued. 55 /// </summary> 56 public abstract void Run(); 57 39 58 /// <summary> 40 59 /// Queues the task for execution. 41 60 /// </summary> 42 61 /// <param name="task">The task to queue.</param> 43 [OperationContract] 44 void QueueTask(Task task); 62 public abstract void QueueTask(Task task); 45 63 46 64 /// <summary> … … 48 66 /// </summary> 49 67 /// <param name="task">The task to schedule</param> 50 [OperationContract] 51 void ScheduleTask(Task task); 68 public abstract void ScheduleTask(Task task); 52 69 53 70 /// <summary> … … 57 74 /// remove requested tasks and not the scheduled ones</remarks> 58 75 /// <param name="task">The task to cancel.</param> 59 [OperationContract] 60 void UnqueueTask(Task task); 76 public abstract void UnqueueTask(Task task); 77 78 /// <summary> 79 /// Gets whether a task is currently queued for execution, outside of the 80 /// scheduled time. 81 /// </summary> 82 /// <param name="task">The task to query.</param> 83 /// <returns>True if the task is currently queued, false otherwise.</returns> 84 internal abstract bool IsTaskQueued(Task task); 61 85 62 86 /// <summary> … … 67 91 /// restart. Therefore this fuction has to be explicitly called by clients. 68 92 /// </summary> 69 [OperationContract]70 void QueueRestartTasks();71 72 /// <summary>73 /// Retrieves the current task list for the executor.74 /// </summary>75 /// <returns>A list of tasks which the executor has registered.</returns>76 [OperationContract]77 ExecutorTasksCollection GetTasks();78 }79 80 public abstract class Executor : IExecutor, IDisposable81 {82 #region IDisposable members83 ~Executor()84 {85 Dispose(false);86 }87 88 protected virtual void Dispose(bool disposing)89 {90 }91 92 public void Dispose()93 {94 Dispose(true);95 GC.SuppressFinalize(this);96 }97 #endregion98 99 /// <summary>100 /// Starts the execution of tasks queued.101 /// </summary>102 public abstract void Run();103 104 /// <summary>105 /// Queues the task for execution.106 /// </summary>107 /// <param name="task">The task to queue.</param>108 public abstract void QueueTask(Task task);109 110 /// <summary>111 /// Schedules the given task for execution.112 /// </summary>113 /// <param name="task">The task to schedule</param>114 public abstract void ScheduleTask(Task task);115 116 /// <summary>117 /// Removes the given task from the execution queue.118 /// </summary>119 /// <remarks>If the task given runs a recurring schedule, the task will only120 /// remove requested tasks and not the scheduled ones</remarks>121 /// <param name="task">The task to cancel.</param>122 public abstract void UnqueueTask(Task task);123 124 /// <summary>125 /// Gets whether a task is currently queued for execution, outside of the126 /// scheduled time.127 /// </summary>128 /// <param name="task">The task to query.</param>129 /// <returns>True if the task is currently queued, false otherwise.</returns>130 internal abstract bool IsTaskQueued(Task task);131 132 /// <summary>133 /// Queues all tasks in the task list which are meant for restart execution.134 /// This is a separate function rather than just running them by default on135 /// task load because creating a new instance and loading the task list136 /// may just be a program restart and may not necessarily be a system137 /// restart. Therefore this fuction has to be explicitly called by clients.138 /// </summary>139 93 public abstract void QueueRestartTasks(); 140 94 … … 146 100 147 101 /// <summary> 148 /// Retrieves the current task list for the executor.149 /// </summary>150 /// <returns>A list of tasks which the executor has registered.</returns>151 public ExecutorTasksCollection GetTasks()152 {153 return Tasks;154 }155 156 /// <summary>157 102 /// The task added event object. 158 103 /// </summary> … … 188 133 /// Constructor. 189 134 /// </summary> 190 /// <param name="executor">The <seealso cref=" IExecutor"/> object owning135 /// <param name="executor">The <seealso cref="Executor"/> object owning 191 136 /// this task list.</param> 192 protected ExecutorTasksCollection( IExecutor executor)137 protected ExecutorTasksCollection(Executor executor) 193 138 { 194 139 Owner = executor; … … 255 200 /// The owner of this task list. 256 201 /// </summary> 257 protected IExecutor Owner { get; private set; }202 protected Executor Owner { get; private set; } 258 203 } 259 204 } -
branches/eraser6/EraserService/Eraser.Manager/RemoteExecutor.cs
r2624 r2735 560 560 throw new NotSupportedException(); 561 561 } 562 563 private new RemoteExecutorClient Owner564 {565 get566 {567 return (RemoteExecutorClient)base.Owner;568 }569 }570 562 } 571 563 } -
branches/eraser6/EraserService/Eraser.Manager/Task.cs
r2624 r2735 289 289 /// The Executor object which is managing this task. 290 290 /// </summary> 291 public IExecutor Executor291 public Executor Executor 292 292 { 293 293 get … … 500 500 } 501 501 502 private IExecutor executor;502 private Executor executor; 503 503 private Schedule schedule; 504 504 private SteppedProgressManager progress; -
branches/eraser6/EraserService/Eraser/Program.cs
r2624 r2735 761 761 /// The global Executor instance. 762 762 /// </summary> 763 public static IExecutor eraserClient;763 public static Executor eraserClient; 764 764 765 765 /// <summary>
Note: See TracChangeset
for help on using the changeset viewer.
