Changeset 2735


Ignore:
Timestamp:
06/29/12 07:40:44 (2 years ago)
Author:
lowjoel
Message:

Revert r2624. Using WCF is good on paper but is not practical, since we've already got all the types nicely done in .NET, and we aren't intending for interop anyway.

Location:
branches/eraser6/EraserService
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/EraserService/Eraser.Manager/DirectExecutor.cs

    r2624 r2735  
    532532            } 
    533533 
    534             private new DirectExecutor Owner 
    535             { 
    536                 get 
    537                 { 
    538                     return (DirectExecutor)base.Owner; 
    539                 } 
    540             } 
    541  
    542534            /// <summary> 
    543535            /// The data store for this object. 
  • branches/eraser6/EraserService/Eraser.Manager/Eraser.Manager.csproj

    r2624 r2735  
    6161    <Reference Include="System.Drawing" /> 
    6262    <Reference Include="System.Security" /> 
    63     <Reference Include="System.ServiceModel" /> 
    6463    <Reference Include="System.Windows.Forms" /> 
    6564    <Reference Include="System.Xml" /> 
  • branches/eraser6/EraserService/Eraser.Manager/Executor.cs

    r2624 r2735  
    2424using System.Text; 
    2525using System.IO; 
    26  
    27 using System.ServiceModel; 
    2826 
    2927namespace Eraser.Manager 
     
    3432    /// abstract as they each will have their own ways of dealing with tasks. 
    3533    /// </summary> 
    36     [ServiceContract(Namespace="http://eraser.sourceforge.net/", SessionMode=SessionMode.Required)] 
    37     public interface IExecutor : IDisposable 
     34    public abstract class Executor : IDisposable 
    3835    { 
     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 
    3958        /// <summary> 
    4059        /// Queues the task for execution. 
    4160        /// </summary> 
    4261        /// <param name="task">The task to queue.</param> 
    43         [OperationContract] 
    44         void QueueTask(Task task); 
     62        public abstract void QueueTask(Task task); 
    4563 
    4664        /// <summary> 
     
    4866        /// </summary> 
    4967        /// <param name="task">The task to schedule</param> 
    50         [OperationContract] 
    51         void ScheduleTask(Task task); 
     68        public abstract void ScheduleTask(Task task); 
    5269 
    5370        /// <summary> 
     
    5774        /// remove requested tasks and not the scheduled ones</remarks> 
    5875        /// <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); 
    6185 
    6286        /// <summary> 
     
    6791        /// restart. Therefore this fuction has to be explicitly called by clients. 
    6892        /// </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> 
    13993        public abstract void QueueRestartTasks(); 
    14094 
     
    146100 
    147101        /// <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> 
    157102        /// The task added event object. 
    158103        /// </summary> 
     
    188133        /// Constructor. 
    189134        /// </summary> 
    190         /// <param name="executor">The <seealso cref="IExecutor"/> object owning 
     135        /// <param name="executor">The <seealso cref="Executor"/> object owning 
    191136        /// this task list.</param> 
    192         protected ExecutorTasksCollection(IExecutor executor) 
     137        protected ExecutorTasksCollection(Executor executor) 
    193138        { 
    194139            Owner = executor; 
     
    255200        /// The owner of this task list. 
    256201        /// </summary> 
    257         protected IExecutor Owner { get; private set; } 
     202        protected Executor Owner { get; private set; } 
    258203    } 
    259204} 
  • branches/eraser6/EraserService/Eraser.Manager/RemoteExecutor.cs

    r2624 r2735  
    560560                throw new NotSupportedException(); 
    561561            } 
    562  
    563             private new RemoteExecutorClient Owner 
    564             { 
    565                 get 
    566                 { 
    567                     return (RemoteExecutorClient)base.Owner; 
    568                 } 
    569             } 
    570562        } 
    571563    } 
  • branches/eraser6/EraserService/Eraser.Manager/Task.cs

    r2624 r2735  
    289289        /// The Executor object which is managing this task. 
    290290        /// </summary> 
    291         public IExecutor Executor 
     291        public Executor Executor 
    292292        { 
    293293            get 
     
    500500        } 
    501501 
    502         private IExecutor executor; 
     502        private Executor executor; 
    503503        private Schedule schedule; 
    504504        private SteppedProgressManager progress; 
  • branches/eraser6/EraserService/Eraser/Program.cs

    r2624 r2735  
    761761        /// The global Executor instance. 
    762762        /// </summary> 
    763         public static IExecutor eraserClient; 
     763        public static Executor eraserClient; 
    764764 
    765765        /// <summary> 
Note: See TracChangeset for help on using the changeset viewer.