Changeset 2624
- Timestamp:
- 5/11/2012 7:46:10 AM (13 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
r2606 r2624 532 532 } 533 533 534 private new DirectExecutor Owner 535 { 536 get 537 { 538 return (DirectExecutor)base.Owner; 539 } 540 } 541 534 542 /// <summary> 535 543 /// The data store for this object. -
branches/eraser6/EraserService/Eraser.Manager/Eraser.Manager.csproj
r2514 r2624 61 61 <Reference Include="System.Drawing" /> 62 62 <Reference Include="System.Security" /> 63 <Reference Include="System.ServiceModel" /> 63 64 <Reference Include="System.Windows.Forms" /> 64 65 <Reference Include="System.Xml" /> -
branches/eraser6/EraserService/Eraser.Manager/Executor.cs
r2610 r2624 24 24 using System.Text; 25 25 using System.IO; 26 27 using System.ServiceModel; 26 28 27 29 namespace Eraser.Manager … … 32 34 /// abstract as they each will have their own ways of dealing with tasks. 33 35 /// </summary> 34 public abstract class Executor : IDisposable 36 [ServiceContract(Namespace="http://eraser.sourceforge.net/", SessionMode=SessionMode.Required)] 37 public interface IExecutor : IDisposable 35 38 { 36 #region IDisposable members37 ~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 #endregion52 53 /// <summary>54 /// Starts the execution of tasks queued.55 /// </summary>56 public abstract void Run();57 58 39 /// <summary> 59 40 /// Queues the task for execution. 60 41 /// </summary> 61 42 /// <param name="task">The task to queue.</param> 62 public abstract void QueueTask(Task task); 43 [OperationContract] 44 void QueueTask(Task task); 63 45 64 46 /// <summary> … … 66 48 /// </summary> 67 49 /// <param name="task">The task to schedule</param> 68 public abstract void ScheduleTask(Task task); 50 [OperationContract] 51 void ScheduleTask(Task task); 69 52 70 53 /// <summary> … … 74 57 /// remove requested tasks and not the scheduled ones</remarks> 75 58 /// <param name="task">The task to cancel.</param> 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); 59 [OperationContract] 60 void UnqueueTask(Task task); 85 61 86 62 /// <summary> … … 91 67 /// restart. Therefore this fuction has to be explicitly called by clients. 92 68 /// </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, IDisposable 81 { 82 #region IDisposable members 83 ~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 #endregion 98 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 only 120 /// 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 the 126 /// 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 on 135 /// task load because creating a new instance and loading the task list 136 /// may just be a program restart and may not necessarily be a system 137 /// restart. Therefore this fuction has to be explicitly called by clients. 138 /// </summary> 93 139 public abstract void QueueRestartTasks(); 94 140 … … 100 146 101 147 /// <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> 102 157 /// The task added event object. 103 158 /// </summary> … … 133 188 /// Constructor. 134 189 /// </summary> 135 /// <param name="executor">The <seealso cref=" Executor"/> object owning190 /// <param name="executor">The <seealso cref="IExecutor"/> object owning 136 191 /// this task list.</param> 137 protected ExecutorTasksCollection( Executor executor)192 protected ExecutorTasksCollection(IExecutor executor) 138 193 { 139 194 Owner = executor; … … 200 255 /// The owner of this task list. 201 256 /// </summary> 202 protected Executor Owner { get; private set; }257 protected IExecutor Owner { get; private set; } 203 258 } 204 259 } -
branches/eraser6/EraserService/Eraser.Manager/RemoteExecutor.cs
r2516 r2624 560 560 throw new NotSupportedException(); 561 561 } 562 563 private new RemoteExecutorClient Owner 564 { 565 get 566 { 567 return (RemoteExecutorClient)base.Owner; 568 } 569 } 562 570 } 563 571 } -
branches/eraser6/EraserService/Eraser.Manager/Task.cs
r2611 r2624 289 289 /// The Executor object which is managing this task. 290 290 /// </summary> 291 public Executor Executor291 public IExecutor Executor 292 292 { 293 293 get … … 500 500 } 501 501 502 private Executor executor;502 private IExecutor executor; 503 503 private Schedule schedule; 504 504 private SteppedProgressManager progress; -
branches/eraser6/EraserService/Eraser/Program.cs
r2617 r2624 761 761 /// The global Executor instance. 762 762 /// </summary> 763 public static Executor eraserClient;763 public static IExecutor eraserClient; 764 764 765 765 /// <summary>
Note: See TracChangeset
for help on using the changeset viewer.
