Changeset 1589


Ignore:
Timestamp:
04/17/09 12:20:19 (12 years ago)
Author:
kgrading
Message:

refactoring (#547)

Location:
trunk/sources
Files:
1 added
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs

    r1579 r1589  
    253253    }
    254254
    255     public List<CachedPlugin> RequestPlugins(List<PluginInfo> requestedPlugins) {
     255    public List<CachedHivePluginInfo> RequestPlugins(List<PluginInfo> requestedPlugins) {
    256256      try {
    257257        return proxy.SendPlugins(requestedPlugins.ToArray()).Plugins;
  • trunk/sources/HeuristicLab.Hive.Client.Core/3.2/Core.cs

    r1530 r1589  
    229229
    230230    void wcfService_StoreFinishedJobResultCompleted(object sender, StoreFinishedJobResultCompletedEventArgs e) {
    231       if (e.Result.Success) {       
    232         lock(engines) {       
    233           //if the engine is running again -> we sent an snapshot. Otherwise the job was finished
    234           //this method has a risk concerning race conditions.
    235           //better expand the sendjobresultcompltedeventargs with a boolean "snapshot?" flag
     231      lock(engines) {
     232        try {
    236233          AppDomain.Unload(appDomains[e.Result.JobId]);
    237234          appDomains.Remove(e.Result.JobId);
    238235          engines.Remove(e.Result.JobId);
    239236          jobs.Remove(e.Result.JobId);
    240           ClientStatusInfo.JobsProcessed++;
    241           Debug.WriteLine("ProcessedJobs to:" + ClientStatusInfo.JobsProcessed);
    242         }       
     237        }
     238        catch (Exception ex) {
     239          Logging.Instance.Error(this.ToString(), "Exception when unloading the appdomain: ", ex);
     240        }
     241      }
     242      if (e.Result.Success) {       
     243     
     244        //if the engine is running again -> we sent an snapshot. Otherwise the job was finished
     245        //this method has a risk concerning race conditions.
     246        //better expand the sendjobresultcompltedeventargs with a boolean "snapshot?" flag
     247
     248        ClientStatusInfo.JobsProcessed++;
     249        Debug.WriteLine("ProcessedJobs to:" + ClientStatusInfo.JobsProcessed);               
    243250      } else {       
    244         Logging.Instance.Error(this.ToString(), "Sending of job " + e.Result.JobId + " failed");
     251        Logging.Instance.Error(this.ToString(), "Sending of job " + e.Result.JobId + " failed, job has been wasted. Message: " + e.Result.StatusMessage);
    245252      }
    246253    }
    247254
    248255    void wcfService_ProcessSnapshotCompleted(object sender, ProcessSnapshotCompletedEventArgs e) {
    249       Logging.Instance.Info(this.ToString(), "Snapshot " + e.Result.JobId + " has been transmitted according to plan");
     256      Logging.Instance.Info(this.ToString(), "Snapshot " + e.Result.JobId + " has been transmitted according to plan.");
    250257    }
    251258
  • trunk/sources/HeuristicLab.Hive.Client.Core/3.2/PluginCache.cs

    r1530 r1589  
    99namespace HeuristicLab.Hive.Client.Core {
    1010  public class PluginCache {
    11     private List<CachedPlugin> pluginCache;
     11    private List<CachedHivePluginInfo> pluginCache;
    1212   
    1313    public PluginCache() {
    14       pluginCache = new List<CachedPlugin>();
     14      pluginCache = new List<CachedHivePluginInfo>();
    1515    }
    1616   
    17     public void AddPlugin(CachedPlugin plugin) {
     17    public void AddPlugin(CachedHivePluginInfo plugin) {
    1818      pluginCache.Add(plugin);   
    1919    }
    2020
    21     public List<CachedPlugin> GetPlugins(List<PluginInfo> requests) {
    22       List<CachedPlugin> neededPlugins = new List<CachedPlugin>();
     21    public List<CachedHivePluginInfo> GetPlugins(List<PluginInfo> requests) {
     22      List<CachedHivePluginInfo> neededPlugins = new List<CachedHivePluginInfo>();
    2323      List<PluginInfo> missingPlugins = new List<PluginInfo>();
    2424      bool found = false;
    2525      foreach (PluginInfo info in requests) {
    26         foreach (CachedPlugin cache in pluginCache) {
     26        foreach (CachedHivePluginInfo cache in pluginCache) {
    2727          if (info.Equals(cache)) {
    2828            neededPlugins.Add(cache);
     
    3636      }
    3737
    38       List<CachedPlugin> receivedPlugins = WcfService.Instance.RequestPlugins(missingPlugins);
     38      List<CachedHivePluginInfo> receivedPlugins = WcfService.Instance.RequestPlugins(missingPlugins);
    3939      if (receivedPlugins != null) {
    4040        neededPlugins.AddRange(receivedPlugins);
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/HeuristicLab.Hive.Contracts-3.2.csproj

    r1580 r1589  
    8787  <ItemGroup>
    8888    <Compile Include="ApplicationConstants.cs" />
     89    <Compile Include="BusinessObjects\CachedPlugin.cs" />
    8990    <Compile Include="BusinessObjects\ClientGroup.cs" />
    9091    <Compile Include="BusinessObjects\HivePluginInfo.cs" />
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/ResponsePlugin.cs

    r1530 r1589  
    1111  public class ResponsePlugin : Response {
    1212    [DataMember]
    13     public List<CachedPlugin> Plugins { get; set; }
     13    public List<CachedHivePluginInfo> Plugins { get; set; }
    1414  }
    1515}
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HeuristicLab.Hive.Engine-3.2.csproj

    r1579 r1589  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.21022</ProductVersion>
     6    <ProductVersion>9.0.30729</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}</ProjectGuid>
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs

    r1580 r1589  
    9393        pluginInfo.BuildDate = info.BuildDate.ToString();
    9494
     95
     96
    9597        pluginsNeeded.Add(pluginInfo);
    9698      }
  • trunk/sources/HeuristicLab.Hive.JobBase/3.2/TestJob.cs

    r1530 r1589  
    3737
    3838    public override void Run() {
    39       int max = 10;
     39      int max = 100;
    4040      while(runValue < max && abort == false) {
    4141        //for (int y = 0; y < Int32.MaxValue; y++) ;
  • trunk/sources/HeuristicLab.PluginInfrastructure/HeuristicLab.PluginInfrastructure.csproj

    r1474 r1589  
    8686    <Compile Include="BaseClasses\ApplicationBase.cs" />
    8787    <Compile Include="BaseClasses\PluginBase.cs" />
    88     <Compile Include="CachedPlugin.cs" />
    8988    <Compile Include="ClassInfoAttribute.cs" />
    9089    <Compile Include="Interfaces\IApplication.cs" />
Note: See TracChangeset for help on using the changeset viewer.