Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/05/11 22:35:40 (13 years ago)
Author:
cneumuel
Message:

#1233

  • refactoring of slave core
  • created JobManager, which is responsible for managing jobs without knowing anything about the service. this class is easier testable than slave core
  • lots of cleanup
  • created console test project for slave
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs

    r6004 r6357  
    2323using System.Collections.Generic;
    2424using HeuristicLab.Common;
     25using HeuristicLab.Hive;
     26using HeuristicLab.PluginInfrastructure;
    2527
    2628namespace HeuristicLab.Clients.Hive.SlaveCore {
     
    2931  /// WcfService class is implemented as a Singleton and works as a communication Layer with the Server
    3032  /// </summary>
    31   public class WcfService : MarshalByRefObject {
     33  public class WcfService : MarshalByRefObject, IPluginProvider {
    3234    private static WcfService instance;
    3335    /// <summary>
     
    6264    }
    6365
    64     public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData) {
    65       return CallHiveService(s => s.AddChildJob(parentJobId, job, jobData));
     66    public Guid AddChildJob(Guid parentJobId, Job job, IJob jobDataObject) {
     67      return CallHiveService(s => {
     68        JobData jobData = new JobData();
     69        IEnumerable<Type> types;
     70        jobData.Data = PersistenceUtil.Serialize(jobDataObject, out types);
     71        var plugins = new List<IPluginDescription>();
     72        PluginUtil.CollectDeclaringPlugins(plugins, types);
     73        job.PluginsNeededIds = PluginUtil.GetPluginDependencies(s, new List<Plugin>(), new List<Plugin>(), plugins, false);
     74        return s.AddChildJob(parentJobId, job, jobData);
     75      });
    6676    }
    6777
Note: See TracChangeset for help on using the changeset viewer.