Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4042


Ignore:
Timestamp:
07/18/10 22:16:04 (14 years ago)
Author:
kgrading
Message:

#828 added various improvements to the plugin cache manager, the execution engine, the transaction handling on the serverside and the server console

Location:
branches/3.2/sources
Files:
8 added
29 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/Core.cs

    r3931 r4042  
    334334      if (e.Result.StatusMessage != ApplicationConstants.RESPONSE_COMMUNICATOR_NO_JOBS_LEFT) {
    335335        Logger.Info("Received new job with id " + e.Result.Job.Id);     
    336         bool sandboxed = false;
    337         List<byte[]> files = new List<byte[]>();
     336        bool sandboxed = false;       
    338337        Logger.Debug("Fetching plugins for job " + e.Result.Job.Id);
    339         foreach (CachedHivePluginInfoDto plugininfo in PluginCache.Instance.GetPlugins(e.Result.Job.PluginsNeeded))
    340           files.AddRange(plugininfo.PluginFiles);
     338
     339        PluginCache.Instance.PreparePlugins(e.Result.Job.PluginsNeeded);
     340
     341//        foreach (CachedHivePluginInfoDto plugininfo in PluginCache.Instance.GetPlugins(e.Result.Job.PluginsNeeded))
     342  //        files.AddRange(plugininfo.PluginFiles);
    341343        Logger.Debug("Plugins fetched for job " + e.Result.Job.Id);
    342         AppDomain appDomain = HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(e.Result.Job.Id.ToString(), files);
    343         appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    344         lock (engines) {
    345           if (!jobs.ContainsKey(e.Result.Job.Id)) {
    346             jobs.Add(e.Result.Job.Id, e.Result.Job);
    347             appDomains.Add(e.Result.Job.Id, appDomain);
    348             Logger.Debug("Creating AppDomain");
    349             Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
    350             Logger.Debug("Created AppDomain");
    351             engine.JobId = e.Result.Job.Id;
    352             engine.Queue = MessageQueue.GetInstance();
    353             Logger.Debug("Starting Engine for job " + e.Result.Job.Id);
    354             engine.Start(e.Data);
    355             engines.Add(e.Result.Job.Id, engine);
    356 
    357             ClientStatusInfo.JobsFetched++;
    358 
    359             Logger.Info("Increment FetchedJobs to:" + ClientStatusInfo.JobsFetched);
     344        try {
     345          AppDomain appDomain =
     346            HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(
     347              e.Result.Job.Id.ToString(), null);
     348          appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException);
     349          lock (engines) {
     350            if (!jobs.ContainsKey(e.Result.Job.Id)) {
     351              jobs.Add(e.Result.Job.Id, e.Result.Job);
     352              appDomains.Add(e.Result.Job.Id, appDomain);
     353              Logger.Debug("Creating AppDomain");
     354              Executor engine =
     355                (Executor)
     356                appDomain.CreateInstanceAndUnwrap(typeof (Executor).Assembly.GetName().Name, typeof (Executor).FullName);
     357              Logger.Debug("Created AppDomain");
     358              engine.JobId = e.Result.Job.Id;
     359              engine.Queue = MessageQueue.GetInstance();
     360              Logger.Debug("Starting Engine for job " + e.Result.Job.Id);
     361              engine.Start(e.Data);
     362              engines.Add(e.Result.Job.Id, engine);
     363
     364              ClientStatusInfo.JobsFetched++;
     365
     366              Logger.Info("Increment FetchedJobs to:" + ClientStatusInfo.JobsFetched);
     367            }
    360368          }
     369        } catch(Exception exception) {
     370          Logger.Error("Creating the Appdomain and loading the job failed for job " + e.Result.Job.Id);
     371          Logger.Error("Error thrown is: ", exception);
     372          CurrentlyFetching = false;
     373          KillAppDomain(e.Result.Job.Id);
    361374        }
    362375      } else
     
    482495      lock (engines) {
    483496        try {
    484           engines[id].Dispose(); 
    485           appDomains[id].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    486           AppDomain.Unload(appDomains[id]);
    487           appDomains.Remove(id);
     497          if(engines.ContainsKey(id))
     498            engines[id].Dispose();
     499          if (appDomains.ContainsKey(id)) {
     500            appDomains[id].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException);
     501            AppDomain.Unload(appDomains[id]);
     502            appDomains.Remove(id);
     503          }
    488504          engines.Remove(id);
    489505          jobs.Remove(id);
     506          GC.Collect();
    490507        }
    491508        catch (Exception ex) {
  • branches/3.2/sources/HeuristicLab.Hive.Client.Core/3.2/PluginCache.cs

    r3578 r4042  
    88using HeuristicLab.Hive.Contracts.BusinessObjects;
    99using HeuristicLab.Tracing;
     10using System.IO;
    1011
    1112namespace HeuristicLab.Hive.Client.Core {
     
    6768    }
    6869
     70
     71    internal void PreparePlugins(List<HivePluginInfoDto> requiredPlugins) {
     72      List<HivePluginInfoDto> missingPlugins = new List<HivePluginInfoDto>();
     73      foreach (HivePluginInfoDto requiredPlugin in requiredPlugins) {
     74        if(ApplicationManager.Manager.Plugins.Count(ipd => ipd.Version.Major == requiredPlugin.Version.Major && ipd.Version.Minor >= requiredPlugin.Version.Minor) == 0) {
     75          missingPlugins.Add(requiredPlugin);             
     76        }
     77      }
     78
     79      Logger.Debug("Requesting missing plugins");
     80      List<CachedHivePluginInfoDto> receivedPlugins = WcfService.Instance.RequestPlugins(missingPlugins);
     81      Logger.Debug("Requested missing plugins");
     82
     83      foreach (CachedHivePluginInfoDto receivedPlugin in receivedPlugins) {
     84        foreach (HivePluginFile hpf in receivedPlugin.PluginFiles) {
     85          Logger.Info("writing file " + hpf.Name);
     86          File.WriteAllBytes("C:\\temp\\" + hpf.Name.Split('\\').Last(), hpf.BinaryFile);
     87        }       
     88      }
     89
     90    }
    6991  }
    7092}
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/CachedHivePluginInfoDto.cs

    r3011 r4042  
    2525using HeuristicLab.Hive.Contracts.BusinessObjects;
    2626using System.Runtime.Serialization;
     27using HeuristicLab.PluginInfrastructure.Manager;
    2728
    2829namespace HeuristicLab.PluginInfrastructure {
     
    3031  [Serializable]
    3132  public class CachedHivePluginInfoDto : HivePluginInfoDto {
    32 
    33     private List<byte[]> pluginFiles = new List<byte[]>();
     33   
    3434    /// <summary>
    3535    /// stores the plugin files in a list of byte arrays
    3636    /// </summary>
    3737    [DataMember]
    38     public List<byte[]> PluginFiles {
    39       get { return pluginFiles; }
    40       set { pluginFiles = value; }
     38    public List<HivePluginFile> PluginFiles { get; set; }
     39
     40    public CachedHivePluginInfoDto() {
     41      PluginFiles = new List<HivePluginFile>();
    4142    }
    4243  }
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/HivePluginInfoDto.cs

    r3011 r4042  
    3737
    3838    [DataMember]
    39     public String Version { get; set; }
     39    public Version Version { get; set; }
    4040
    4141    [DataMember]
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/HeuristicLab.Hive.Contracts-3.2.csproj

    r3578 r4042  
    9191    <Compile Include="BusinessObjects\CachedHivePluginInfoDto.cs" />
    9292    <Compile Include="BusinessObjects\ClientGroupDto.cs" />
     93    <Compile Include="BusinessObjects\HivePluginFile.cs" />
    9394    <Compile Include="BusinessObjects\ResourceDto.cs" />
    9495    <Compile Include="BusinessObjects\SerializedJob.cs" />
     
    139140      <Name>HeuristicLab.PluginInfrastructure</Name>
    140141    </ProjectReference>
     142    <ProjectReference Include="..\..\HeuristicLab.Tracing\3.2\HeuristicLab.Tracing-3.2.csproj">
     143      <Project>{EE2034D9-6E27-48A1-B855-42D45F69A4FC}</Project>
     144      <Name>HeuristicLab.Tracing-3.2</Name>
     145    </ProjectReference>
    141146  </ItemGroup>
    142147  <ItemGroup>
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/Interfaces/IExecutionEngineFacade.cs

    r3220 r4042  
    3737    Response RequestSnapshot(Guid jobId);
    3838    [OperationContract]
    39     ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested);
     39    ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested, bool snapshot);
    4040    [OperationContract]
    4141    Response AbortJob(Guid jobId);   
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/Interfaces/IJobManager.cs

    r3578 r4042  
    4848    ResponseObject<JobDto> GetLastJobResultOf(Guid jobId);
    4949    [OperationContract]
    50     ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested);
     50    ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot);
    5151    [OperationContract]
    5252    ResponseList<JobResult> GetAllJobResults(Guid jobId);
  • branches/3.2/sources/HeuristicLab.Hive.Contracts/3.2/MultiStream.cs

    r2117 r4042  
    66using System.IO;
    77using System.Collections;
     8using HeuristicLab.Tracing;
    89
    910namespace HeuristicLab.Hive.Contracts {
     
    102103
    103104    protected override void Dispose(bool disposing) {
    104       if (!disposing) {
     105      //if (!disposing) {
    105106        foreach (Stream s in this.streamList) {
     107          Console.WriteLine("DISPOSING STREAM");
    106108          s.Dispose();
    107109        }
    108       }
     110      //}
    109111     
    110112      base.Dispose(disposing);
  • branches/3.2/sources/HeuristicLab.Hive.Engine/3.2/HiveEngine.cs

    r3578 r4042  
    136136          lock (locker) {
    137137            Logger.Debug("HiveEngine: Results-polling - GetLastResult");
    138             response = executionEngineFacade.GetLastSerializedResult(jobId, false);
     138            response = executionEngineFacade.GetLastSerializedResult(jobId, false, false);
    139139            Logger.Debug("HiveEngine: Results-polling - Server: " + response.StatusMessage + " success: " + response.Success);
    140140            // loop while
     
    144144            // 4. the result that we get from the server is a snapshot and not the final result
    145145            if (abortRequested) return;
    146             if (response.Success && response.Obj != null) {
     146              if (response.Success && response.Obj != null && response.StatusMessage != ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE) {
    147147              Logger.Debug("HiveEngine: Results-polling - Got result!");
    148148              restoredJob = (Job)PersistenceManager.RestoreFromGZip(response.Obj.SerializedJobData);
     
    171171          // job is finished already
    172172          Logger.Debug("HiveEngine: Abort - GetLastResult(false)");
    173           response = executionEngineFacade.GetLastSerializedResult(jobId, false);
     173          response = executionEngineFacade.GetLastSerializedResult(jobId, false, false);
    174174          Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success);
    175175        } else {
     
    179179            Thread.Sleep(SNAPSHOT_POLLING_INTERVAL_MS);
    180180            Logger.Debug("HiveEngine: Abort - GetLastResult(true)");
    181             response = executionEngineFacade.GetLastSerializedResult(jobId, true);
     181            response = executionEngineFacade.GetLastSerializedResult(jobId, false, true);
    182182            Logger.Debug("HiveEngine: Abort - Server: " + response.StatusMessage + " success: " + response.Success);
    183183            retryCount++;
     
    264264          new HivePluginInfoDto();
    265265        pluginInfo.Name = uniquePlugin.Name;
    266         pluginInfo.Version = uniquePlugin.Version.ToString();
     266        pluginInfo.Version = uniquePlugin.Version;
    267267        pluginInfo.BuildDate = uniquePlugin.BuildDate;
    268268        pluginsNeeded.Add(pluginInfo);
  • branches/3.2/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/JobAdapter.cs

    r3011 r4042  
    369369          //first check if pluginInfo already exists in the db
    370370          HivePluginInfoDto found = PluginInfoAdapter.GetByNameVersionBuilddate(
    371             pluginInfo.Name, pluginInfo.Version, pluginInfo.BuildDate);
     371            pluginInfo.Name, pluginInfo.Version.ToString(), pluginInfo.BuildDate);
    372372          if (found != null) {
    373373            pluginInfo.Id = found.Id;
  • branches/3.2/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/PluginInfoAdapter.cs

    r3011 r4042  
    2727        row.PluginId = pluginInfo.Id;
    2828        row.Name = pluginInfo.Name;
    29         row.Version = pluginInfo.Version;
     29        row.Version = pluginInfo.Version.ToString();
    3030        row.BuildDate = pluginInfo.BuildDate;
    3131
     
    4848
    4949        if (!row.IsVersionNull()) {
    50           pluginInfo.Version = row.Version;
     50          pluginInfo.Version = new Version(row.Version);
    5151        } else {
    5252          pluginInfo.Version = null;
  • branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HeuristicLab.Hive.Server.Console-3.2.csproj

    r3931 r4042  
    132132    </Compile>
    133133    <Compile Include="HiveServerConsolePlugin.cs" />
     134    <Compile Include="JobDataFetcher.cs" />
     135    <Compile Include="JobListView.cs">
     136      <SubType>Component</SubType>
     137    </Compile>
     138    <Compile Include="JobListViewControl.cs">
     139      <SubType>UserControl</SubType>
     140    </Compile>
     141    <Compile Include="JobListViewControl.Designer.cs">
     142      <DependentUpon>JobListViewControl.cs</DependentUpon>
     143    </Compile>
    134144    <Compile Include="LogonDlg.cs">
    135145      <SubType>Form</SubType>
     
    159169      <DependentUpon>HiveServerManagementConsole.cs</DependentUpon>
    160170      <SubType>Designer</SubType>
     171    </EmbeddedResource>
     172    <EmbeddedResource Include="JobListView.resx">
     173      <DependentUpon>JobListView.cs</DependentUpon>
     174    </EmbeddedResource>
     175    <EmbeddedResource Include="JobListViewControl.resx">
     176      <DependentUpon>JobListViewControl.cs</DependentUpon>
    161177    </EmbeddedResource>
    162178    <EmbeddedResource Include="LogonDlg.resx">
  • branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.Designer.cs

    r3578 r4042  
    6767      this.tpJobControl = new System.Windows.Forms.TabPage();
    6868      this.scJobControl = new System.Windows.Forms.SplitContainer();
    69       this.lvJobControl = new System.Windows.Forms.ListView();
     69      this.calculatingJobTabControl = new System.Windows.Forms.TabControl();
     70      this.calculatingJobTabPage = new System.Windows.Forms.TabPage();
     71      this.splitContainer5 = new System.Windows.Forms.SplitContainer();
     72      this.cmb_calculatingJob_count = new System.Windows.Forms.ComboBox();
     73      this.btn_calculatingJobs_next = new System.Windows.Forms.Button();
     74      this.btn_calculatingJobs_prev = new System.Windows.Forms.Button();
     75      this.lv_calculatingJobs = new System.Windows.Forms.ListView();
    7076      this.contextMenuJob = new System.Windows.Forms.ContextMenuStrip(this.components);
    71       this.menuItemAbortJob = new System.Windows.Forms.ToolStripMenuItem();
     77      this.offlineItemAbortJob = new System.Windows.Forms.ToolStripMenuItem();
    7278      this.menuItemGetSnapshot = new System.Windows.Forms.ToolStripMenuItem();
    7379      this.ilSmallImgJob = new System.Windows.Forms.ImageList(this.components);
     80      this.finishedJobsTabPage = new System.Windows.Forms.TabPage();
     81      this.splitContainer2 = new System.Windows.Forms.SplitContainer();
     82      this.cmb_finishedJob_count = new System.Windows.Forms.ComboBox();
     83      this.btn_finishedJob_next = new System.Windows.Forms.Button();
     84      this.btn_finishedJob_prev = new System.Windows.Forms.Button();
     85      this.lv_finishedJobs = new System.Windows.Forms.ListView();
     86      this.offlineJobsTabPage = new System.Windows.Forms.TabPage();
     87      this.splitContainer4 = new System.Windows.Forms.SplitContainer();
     88      this.cmb_offlineJob_count = new System.Windows.Forms.ComboBox();
     89      this.btn_offlineJob_next = new System.Windows.Forms.Button();
     90      this.btn_offlinejob_prev = new System.Windows.Forms.Button();
     91      this.lv_offlineJobs = new System.Windows.Forms.ListView();
     92      this.AbortContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
    7493      this.ilSmallImgClient = new System.Windows.Forms.ImageList(this.components);
    7594      this.tpClientControl = new System.Windows.Forms.TabPage();
     
    85104      this.tcManagementConsole = new System.Windows.Forms.TabControl();
    86105      this.checkBox1 = new System.Windows.Forms.CheckBox();
     106      this.splitContainer3 = new System.Windows.Forms.SplitContainer();
     107      this.comboBox1 = new System.Windows.Forms.ComboBox();
     108      this.button1 = new System.Windows.Forms.Button();
     109      this.button2 = new System.Windows.Forms.Button();
     110      this.listView1 = new System.Windows.Forms.ListView();
     111      this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
     112      this.calcToolStripAbortItem = new System.Windows.Forms.ToolStripMenuItem();
    87113      this.menuStrip1.SuspendLayout();
    88114      this.plClientDetails.SuspendLayout();
     
    97123      this.scJobControl.Panel2.SuspendLayout();
    98124      this.scJobControl.SuspendLayout();
     125      this.calculatingJobTabControl.SuspendLayout();
     126      this.calculatingJobTabPage.SuspendLayout();
     127      this.splitContainer5.Panel1.SuspendLayout();
     128      this.splitContainer5.Panel2.SuspendLayout();
     129      this.splitContainer5.SuspendLayout();
    99130      this.contextMenuJob.SuspendLayout();
     131      this.finishedJobsTabPage.SuspendLayout();
     132      this.splitContainer2.Panel1.SuspendLayout();
     133      this.splitContainer2.Panel2.SuspendLayout();
     134      this.splitContainer2.SuspendLayout();
     135      this.offlineJobsTabPage.SuspendLayout();
     136      this.splitContainer4.Panel1.SuspendLayout();
     137      this.splitContainer4.Panel2.SuspendLayout();
     138      this.splitContainer4.SuspendLayout();
     139      this.AbortContextMenuStrip.SuspendLayout();
    100140      this.tpClientControl.SuspendLayout();
    101141      this.scClientControl.Panel1.SuspendLayout();
     
    107147      this.contextMenuGroup.SuspendLayout();
    108148      this.tcManagementConsole.SuspendLayout();
     149      this.splitContainer3.Panel1.SuspendLayout();
     150      this.splitContainer3.Panel2.SuspendLayout();
     151      this.splitContainer3.SuspendLayout();
    109152      this.SuspendLayout();
    110153      //
     
    480523      // scJobControl.Panel1
    481524      //
    482       this.scJobControl.Panel1.Controls.Add(this.lvJobControl);
     525      this.scJobControl.Panel1.Controls.Add(this.calculatingJobTabControl);
    483526      //
    484527      // scJobControl.Panel2
     
    489532      this.scJobControl.TabIndex = 0;
    490533      //
    491       // lvJobControl
    492       //
    493       this.lvJobControl.AllowDrop = true;
    494       this.lvJobControl.ContextMenuStrip = this.contextMenuJob;
    495       this.lvJobControl.Dock = System.Windows.Forms.DockStyle.Fill;
    496       this.lvJobControl.LargeImageList = this.ilLargeImgJob;
    497       this.lvJobControl.Location = new System.Drawing.Point(0, 0);
    498       this.lvJobControl.MultiSelect = false;
    499       this.lvJobControl.Name = "lvJobControl";
    500       this.lvJobControl.Size = new System.Drawing.Size(454, 386);
    501       this.lvJobControl.SmallImageList = this.ilSmallImgJob;
    502       this.lvJobControl.TabIndex = 0;
    503       this.lvJobControl.UseCompatibleStateImageBehavior = false;
    504       this.lvJobControl.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lvJobControl_MouseUp);
    505       this.lvJobControl.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lvJobControl_MouseMove);
    506       this.lvJobControl.Click += new System.EventHandler(this.OnLVJobControlClicked);
     534      // calculatingJobTabControl
     535      //
     536      this.calculatingJobTabControl.Controls.Add(this.calculatingJobTabPage);
     537      this.calculatingJobTabControl.Controls.Add(this.finishedJobsTabPage);
     538      this.calculatingJobTabControl.Controls.Add(this.offlineJobsTabPage);
     539      this.calculatingJobTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
     540      this.calculatingJobTabControl.Location = new System.Drawing.Point(0, 0);
     541      this.calculatingJobTabControl.Name = "calculatingJobTabControl";
     542      this.calculatingJobTabControl.SelectedIndex = 0;
     543      this.calculatingJobTabControl.Size = new System.Drawing.Size(454, 386);
     544      this.calculatingJobTabControl.TabIndex = 0;
     545      //
     546      // calculatingJobTabPage
     547      //
     548      this.calculatingJobTabPage.Controls.Add(this.splitContainer5);
     549      this.calculatingJobTabPage.Location = new System.Drawing.Point(4, 22);
     550      this.calculatingJobTabPage.Name = "calculatingJobTabPage";
     551      this.calculatingJobTabPage.Padding = new System.Windows.Forms.Padding(3);
     552      this.calculatingJobTabPage.Size = new System.Drawing.Size(446, 360);
     553      this.calculatingJobTabPage.TabIndex = 2;
     554      this.calculatingJobTabPage.Text = "Calculating Jobs";
     555      this.calculatingJobTabPage.UseVisualStyleBackColor = true;
     556      //
     557      // splitContainer5
     558      //
     559      this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill;
     560      this.splitContainer5.Location = new System.Drawing.Point(3, 3);
     561      this.splitContainer5.Name = "splitContainer5";
     562      this.splitContainer5.Orientation = System.Windows.Forms.Orientation.Horizontal;
     563      //
     564      // splitContainer5.Panel1
     565      //
     566      this.splitContainer5.Panel1.Controls.Add(this.cmb_calculatingJob_count);
     567      this.splitContainer5.Panel1.Controls.Add(this.btn_calculatingJobs_next);
     568      this.splitContainer5.Panel1.Controls.Add(this.btn_calculatingJobs_prev);
     569      //
     570      // splitContainer5.Panel2
     571      //
     572      this.splitContainer5.Panel2.Controls.Add(this.lv_calculatingJobs);
     573      this.splitContainer5.Size = new System.Drawing.Size(440, 354);
     574      this.splitContainer5.SplitterDistance = 28;
     575      this.splitContainer5.TabIndex = 3;
     576      //
     577      // cmb_calculatingJob_count
     578      //
     579      this.cmb_calculatingJob_count.FormattingEnabled = true;
     580      this.cmb_calculatingJob_count.Items.AddRange(new object[] {
     581            "25",
     582            "50",
     583            "75",
     584            "100"});
     585      this.cmb_calculatingJob_count.Location = new System.Drawing.Point(165, 3);
     586      this.cmb_calculatingJob_count.Name = "cmb_calculatingJob_count";
     587      this.cmb_calculatingJob_count.Size = new System.Drawing.Size(48, 21);
     588      this.cmb_calculatingJob_count.TabIndex = 2;
     589      this.cmb_calculatingJob_count.SelectedIndexChanged += new System.EventHandler(this.cmb_count_SelectedIndexChanged);
     590      //
     591      // btn_calculatingJobs_next
     592      //
     593      this.btn_calculatingJobs_next.Location = new System.Drawing.Point(84, 3);
     594      this.btn_calculatingJobs_next.Name = "btn_calculatingJobs_next";
     595      this.btn_calculatingJobs_next.Size = new System.Drawing.Size(75, 23);
     596      this.btn_calculatingJobs_next.TabIndex = 1;
     597      this.btn_calculatingJobs_next.Text = "-->";
     598      this.btn_calculatingJobs_next.UseVisualStyleBackColor = true;
     599      this.btn_calculatingJobs_next.Click += new System.EventHandler(this.btn_next_Click);
     600      //
     601      // btn_calculatingJobs_prev
     602      //
     603      this.btn_calculatingJobs_prev.Location = new System.Drawing.Point(3, 3);
     604      this.btn_calculatingJobs_prev.Name = "btn_calculatingJobs_prev";
     605      this.btn_calculatingJobs_prev.Size = new System.Drawing.Size(75, 23);
     606      this.btn_calculatingJobs_prev.TabIndex = 0;
     607      this.btn_calculatingJobs_prev.Text = "<--";
     608      this.btn_calculatingJobs_prev.UseVisualStyleBackColor = true;
     609      this.btn_calculatingJobs_prev.Click += new System.EventHandler(this.btn_prev_Click);
     610      //
     611      // lv_calculatingJobs
     612      //
     613      this.lv_calculatingJobs.ContextMenuStrip = this.contextMenuJob;
     614      this.lv_calculatingJobs.Dock = System.Windows.Forms.DockStyle.Fill;
     615      this.lv_calculatingJobs.LargeImageList = this.ilLargeImgJob;
     616      this.lv_calculatingJobs.Location = new System.Drawing.Point(0, 0);
     617      this.lv_calculatingJobs.Name = "lv_calculatingJobs";
     618      this.lv_calculatingJobs.Size = new System.Drawing.Size(440, 322);
     619      this.lv_calculatingJobs.SmallImageList = this.ilSmallImgJob;
     620      this.lv_calculatingJobs.TabIndex = 0;
     621      this.lv_calculatingJobs.UseCompatibleStateImageBehavior = false;
     622      this.lv_calculatingJobs.SelectedIndexChanged += new System.EventHandler(this.lv_Jobs_SelectedIndexChanged);
    507623      //
    508624      // contextMenuJob
    509625      //
    510626      this.contextMenuJob.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    511             this.menuItemAbortJob,
    512             this.menuItemGetSnapshot});
     627            this.menuItemGetSnapshot,
     628            this.calcToolStripAbortItem});
    513629      this.contextMenuJob.Name = "contextMenuJob";
    514630      this.contextMenuJob.Size = new System.Drawing.Size(145, 48);
    515631      //
    516       // menuItemAbortJob
    517       //
    518       this.menuItemAbortJob.Name = "menuItemAbortJob";
    519       this.menuItemAbortJob.Size = new System.Drawing.Size(144, 22);
    520       this.menuItemAbortJob.Text = "Abort";
     632      // offlineItemAbortJob
     633      //
     634      this.offlineItemAbortJob.Name = "offlineItemAbortJob";
     635      this.offlineItemAbortJob.Size = new System.Drawing.Size(152, 22);
     636      this.offlineItemAbortJob.Text = "Abort";
    521637      //
    522638      // menuItemGetSnapshot
     
    533649      this.ilSmallImgJob.Images.SetKeyName(1, "Forward.png");
    534650      this.ilSmallImgJob.Images.SetKeyName(2, "pause.png");
     651      //
     652      // finishedJobsTabPage
     653      //
     654      this.finishedJobsTabPage.Controls.Add(this.splitContainer2);
     655      this.finishedJobsTabPage.Location = new System.Drawing.Point(4, 22);
     656      this.finishedJobsTabPage.Name = "finishedJobsTabPage";
     657      this.finishedJobsTabPage.Padding = new System.Windows.Forms.Padding(3);
     658      this.finishedJobsTabPage.Size = new System.Drawing.Size(446, 360);
     659      this.finishedJobsTabPage.TabIndex = 0;
     660      this.finishedJobsTabPage.Text = "Finished Jobs";
     661      this.finishedJobsTabPage.UseVisualStyleBackColor = true;
     662      //
     663      // splitContainer2
     664      //
     665      this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
     666      this.splitContainer2.Location = new System.Drawing.Point(3, 3);
     667      this.splitContainer2.Name = "splitContainer2";
     668      this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
     669      //
     670      // splitContainer2.Panel1
     671      //
     672      this.splitContainer2.Panel1.Controls.Add(this.cmb_finishedJob_count);
     673      this.splitContainer2.Panel1.Controls.Add(this.btn_finishedJob_next);
     674      this.splitContainer2.Panel1.Controls.Add(this.btn_finishedJob_prev);
     675      //
     676      // splitContainer2.Panel2
     677      //
     678      this.splitContainer2.Panel2.Controls.Add(this.lv_finishedJobs);
     679      this.splitContainer2.Size = new System.Drawing.Size(440, 354);
     680      this.splitContainer2.SplitterDistance = 28;
     681      this.splitContainer2.TabIndex = 2;
     682      //
     683      // cmb_finishedJob_count
     684      //
     685      this.cmb_finishedJob_count.FormattingEnabled = true;
     686      this.cmb_finishedJob_count.Items.AddRange(new object[] {
     687            "25",
     688            "50",
     689            "75",
     690            "100"});
     691      this.cmb_finishedJob_count.Location = new System.Drawing.Point(165, 3);
     692      this.cmb_finishedJob_count.Name = "cmb_finishedJob_count";
     693      this.cmb_finishedJob_count.Size = new System.Drawing.Size(48, 21);
     694      this.cmb_finishedJob_count.TabIndex = 2;
     695      this.cmb_finishedJob_count.SelectedIndexChanged += new System.EventHandler(this.cmb_count_SelectedIndexChanged);
     696      //
     697      // btn_finishedJob_next
     698      //
     699      this.btn_finishedJob_next.Location = new System.Drawing.Point(84, 3);
     700      this.btn_finishedJob_next.Name = "btn_finishedJob_next";
     701      this.btn_finishedJob_next.Size = new System.Drawing.Size(75, 23);
     702      this.btn_finishedJob_next.TabIndex = 1;
     703      this.btn_finishedJob_next.Text = "-->";
     704      this.btn_finishedJob_next.UseVisualStyleBackColor = true;
     705      this.btn_finishedJob_next.Click += new System.EventHandler(this.btn_next_Click);
     706      //
     707      // btn_finishedJob_prev
     708      //
     709      this.btn_finishedJob_prev.Location = new System.Drawing.Point(3, 3);
     710      this.btn_finishedJob_prev.Name = "btn_finishedJob_prev";
     711      this.btn_finishedJob_prev.Size = new System.Drawing.Size(75, 23);
     712      this.btn_finishedJob_prev.TabIndex = 0;
     713      this.btn_finishedJob_prev.Text = "<--";
     714      this.btn_finishedJob_prev.UseVisualStyleBackColor = true;
     715      this.btn_finishedJob_prev.Click += new System.EventHandler(this.btn_prev_Click);
     716      //
     717      // lv_finishedJobs
     718      //
     719      this.lv_finishedJobs.Dock = System.Windows.Forms.DockStyle.Fill;
     720      this.lv_finishedJobs.LargeImageList = this.ilLargeImgJob;
     721      this.lv_finishedJobs.Location = new System.Drawing.Point(0, 0);
     722      this.lv_finishedJobs.Name = "lv_finishedJobs";
     723      this.lv_finishedJobs.Size = new System.Drawing.Size(440, 322);
     724      this.lv_finishedJobs.SmallImageList = this.ilSmallImgJob;
     725      this.lv_finishedJobs.TabIndex = 0;
     726      this.lv_finishedJobs.UseCompatibleStateImageBehavior = false;
     727      this.lv_finishedJobs.SelectedIndexChanged += new System.EventHandler(this.lv_Jobs_SelectedIndexChanged);
     728      //
     729      // offlineJobsTabPage
     730      //
     731      this.offlineJobsTabPage.Controls.Add(this.splitContainer4);
     732      this.offlineJobsTabPage.Location = new System.Drawing.Point(4, 22);
     733      this.offlineJobsTabPage.Name = "offlineJobsTabPage";
     734      this.offlineJobsTabPage.Padding = new System.Windows.Forms.Padding(3);
     735      this.offlineJobsTabPage.Size = new System.Drawing.Size(446, 360);
     736      this.offlineJobsTabPage.TabIndex = 1;
     737      this.offlineJobsTabPage.Text = "Offline Jobs";
     738      this.offlineJobsTabPage.UseVisualStyleBackColor = true;
     739      //
     740      // splitContainer4
     741      //
     742      this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
     743      this.splitContainer4.Location = new System.Drawing.Point(3, 3);
     744      this.splitContainer4.Name = "splitContainer4";
     745      this.splitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal;
     746      //
     747      // splitContainer4.Panel1
     748      //
     749      this.splitContainer4.Panel1.Controls.Add(this.cmb_offlineJob_count);
     750      this.splitContainer4.Panel1.Controls.Add(this.btn_offlineJob_next);
     751      this.splitContainer4.Panel1.Controls.Add(this.btn_offlinejob_prev);
     752      //
     753      // splitContainer4.Panel2
     754      //
     755      this.splitContainer4.Panel2.Controls.Add(this.lv_offlineJobs);
     756      this.splitContainer4.Size = new System.Drawing.Size(440, 354);
     757      this.splitContainer4.SplitterDistance = 28;
     758      this.splitContainer4.TabIndex = 3;
     759      //
     760      // cmb_offlineJob_count
     761      //
     762      this.cmb_offlineJob_count.FormattingEnabled = true;
     763      this.cmb_offlineJob_count.Items.AddRange(new object[] {
     764            "25",
     765            "50",
     766            "75",
     767            "100"});
     768      this.cmb_offlineJob_count.Location = new System.Drawing.Point(165, 3);
     769      this.cmb_offlineJob_count.Name = "cmb_offlineJob_count";
     770      this.cmb_offlineJob_count.Size = new System.Drawing.Size(48, 21);
     771      this.cmb_offlineJob_count.TabIndex = 2;
     772      this.cmb_offlineJob_count.SelectedIndexChanged += new System.EventHandler(this.cmb_count_SelectedIndexChanged);
     773      //
     774      // btn_offlineJob_next
     775      //
     776      this.btn_offlineJob_next.Location = new System.Drawing.Point(84, 3);
     777      this.btn_offlineJob_next.Name = "btn_offlineJob_next";
     778      this.btn_offlineJob_next.Size = new System.Drawing.Size(75, 23);
     779      this.btn_offlineJob_next.TabIndex = 1;
     780      this.btn_offlineJob_next.Text = "-->";
     781      this.btn_offlineJob_next.UseVisualStyleBackColor = true;
     782      this.btn_offlineJob_next.Click += new System.EventHandler(this.btn_next_Click);
     783      //
     784      // btn_offlinejob_prev
     785      //
     786      this.btn_offlinejob_prev.Location = new System.Drawing.Point(3, 3);
     787      this.btn_offlinejob_prev.Name = "btn_offlinejob_prev";
     788      this.btn_offlinejob_prev.Size = new System.Drawing.Size(75, 23);
     789      this.btn_offlinejob_prev.TabIndex = 0;
     790      this.btn_offlinejob_prev.Text = "<--";
     791      this.btn_offlinejob_prev.UseVisualStyleBackColor = true;
     792      this.btn_offlinejob_prev.Click += new System.EventHandler(this.btn_prev_Click);
     793      //
     794      // lv_offlineJobs
     795      //
     796      this.lv_offlineJobs.ContextMenuStrip = this.AbortContextMenuStrip;
     797      this.lv_offlineJobs.Dock = System.Windows.Forms.DockStyle.Fill;
     798      this.lv_offlineJobs.LargeImageList = this.ilLargeImgJob;
     799      this.lv_offlineJobs.Location = new System.Drawing.Point(0, 0);
     800      this.lv_offlineJobs.Name = "lv_offlineJobs";
     801      this.lv_offlineJobs.Size = new System.Drawing.Size(440, 322);
     802      this.lv_offlineJobs.SmallImageList = this.ilSmallImgJob;
     803      this.lv_offlineJobs.TabIndex = 0;
     804      this.lv_offlineJobs.UseCompatibleStateImageBehavior = false;
     805      this.lv_offlineJobs.SelectedIndexChanged += new System.EventHandler(this.lv_Jobs_SelectedIndexChanged);
     806      //
     807      // AbortContextMenuStrip
     808      //
     809      this.AbortContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     810            this.offlineItemAbortJob});
     811      this.AbortContextMenuStrip.Name = "AbortContextMenuStrip";
     812      this.AbortContextMenuStrip.Size = new System.Drawing.Size(105, 26);
    535813      //
    536814      // ilSmallImgClient
     
    675953      this.checkBox1.Text = "checkBox1";
    676954      this.checkBox1.UseVisualStyleBackColor = true;
     955      //
     956      // splitContainer3
     957      //
     958      this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
     959      this.splitContainer3.Location = new System.Drawing.Point(3, 3);
     960      this.splitContainer3.Name = "splitContainer3";
     961      this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
     962      //
     963      // splitContainer3.Panel1
     964      //
     965      this.splitContainer3.Panel1.Controls.Add(this.comboBox1);
     966      this.splitContainer3.Panel1.Controls.Add(this.button1);
     967      this.splitContainer3.Panel1.Controls.Add(this.button2);
     968      //
     969      // splitContainer3.Panel2
     970      //
     971      this.splitContainer3.Panel2.Controls.Add(this.listView1);
     972      this.splitContainer3.Size = new System.Drawing.Size(440, 354);
     973      this.splitContainer3.SplitterDistance = 28;
     974      this.splitContainer3.TabIndex = 2;
     975      //
     976      // comboBox1
     977      //
     978      this.comboBox1.FormattingEnabled = true;
     979      this.comboBox1.Items.AddRange(new object[] {
     980            "25",
     981            "50",
     982            "75",
     983            "100"});
     984      this.comboBox1.Location = new System.Drawing.Point(165, 3);
     985      this.comboBox1.Name = "comboBox1";
     986      this.comboBox1.Size = new System.Drawing.Size(48, 21);
     987      this.comboBox1.TabIndex = 2;
     988      //
     989      // button1
     990      //
     991      this.button1.Location = new System.Drawing.Point(84, 3);
     992      this.button1.Name = "button1";
     993      this.button1.Size = new System.Drawing.Size(75, 23);
     994      this.button1.TabIndex = 1;
     995      this.button1.Text = "-->";
     996      this.button1.UseVisualStyleBackColor = true;
     997      //
     998      // button2
     999      //
     1000      this.button2.Location = new System.Drawing.Point(3, 3);
     1001      this.button2.Name = "button2";
     1002      this.button2.Size = new System.Drawing.Size(75, 23);
     1003      this.button2.TabIndex = 0;
     1004      this.button2.Text = "<--";
     1005      this.button2.UseVisualStyleBackColor = true;
     1006      //
     1007      // listView1
     1008      //
     1009      this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
     1010      this.listView1.LargeImageList = this.ilLargeImgJob;
     1011      this.listView1.Location = new System.Drawing.Point(0, 0);
     1012      this.listView1.Name = "listView1";
     1013      this.listView1.Size = new System.Drawing.Size(440, 322);
     1014      this.listView1.SmallImageList = this.ilSmallImgJob;
     1015      this.listView1.TabIndex = 0;
     1016      this.listView1.UseCompatibleStateImageBehavior = false;
     1017      //
     1018      // toolStripMenuItem1
     1019      //
     1020      this.toolStripMenuItem1.Name = "toolStripMenuItem1";
     1021      this.toolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
     1022      this.toolStripMenuItem1.Text = "Abort";
     1023      //
     1024      // calcToolStripAbortItem
     1025      //
     1026      this.calcToolStripAbortItem.Name = "calcToolStripAbortItem";
     1027      this.calcToolStripAbortItem.Size = new System.Drawing.Size(144, 22);
     1028      this.calcToolStripAbortItem.Text = "Abort";
    6771029      //
    6781030      // HiveServerManagementConsole
     
    7031055      this.scJobControl.Panel2.ResumeLayout(false);
    7041056      this.scJobControl.ResumeLayout(false);
     1057      this.calculatingJobTabControl.ResumeLayout(false);
     1058      this.calculatingJobTabPage.ResumeLayout(false);
     1059      this.splitContainer5.Panel1.ResumeLayout(false);
     1060      this.splitContainer5.Panel2.ResumeLayout(false);
     1061      this.splitContainer5.ResumeLayout(false);
    7051062      this.contextMenuJob.ResumeLayout(false);
     1063      this.finishedJobsTabPage.ResumeLayout(false);
     1064      this.splitContainer2.Panel1.ResumeLayout(false);
     1065      this.splitContainer2.Panel2.ResumeLayout(false);
     1066      this.splitContainer2.ResumeLayout(false);
     1067      this.offlineJobsTabPage.ResumeLayout(false);
     1068      this.splitContainer4.Panel1.ResumeLayout(false);
     1069      this.splitContainer4.Panel2.ResumeLayout(false);
     1070      this.splitContainer4.ResumeLayout(false);
     1071      this.AbortContextMenuStrip.ResumeLayout(false);
    7061072      this.tpClientControl.ResumeLayout(false);
    7071073      this.scClientControl.Panel1.ResumeLayout(false);
     
    7131079      this.contextMenuGroup.ResumeLayout(false);
    7141080      this.tcManagementConsole.ResumeLayout(false);
     1081      this.splitContainer3.Panel1.ResumeLayout(false);
     1082      this.splitContainer3.Panel2.ResumeLayout(false);
     1083      this.splitContainer3.ResumeLayout(false);
    7151084      this.ResumeLayout(false);
    7161085      this.PerformLayout();
     
    7551124    private System.Windows.Forms.TabPage tpJobControl;
    7561125    private System.Windows.Forms.SplitContainer scJobControl;
    757     private System.Windows.Forms.ListView lvJobControl;
    7581126    private System.Windows.Forms.CheckBox checkBox1;
    7591127    private System.Windows.Forms.ContextMenuStrip contextMenuJob;
    760     private System.Windows.Forms.ToolStripMenuItem menuItemAbortJob;
     1128    private System.Windows.Forms.ToolStripMenuItem offlineItemAbortJob;
    7611129    private System.Windows.Forms.ToolStripMenuItem menuItemGetSnapshot;
    7621130    private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
     
    7791147    private System.Windows.Forms.ToolStripMenuItem projectToolStripMenuItem;
    7801148    private System.Windows.Forms.ToolStripMenuItem menuItemOpenCalendar;
     1149    private System.Windows.Forms.TabControl calculatingJobTabControl;
     1150    private System.Windows.Forms.TabPage finishedJobsTabPage;
     1151    private System.Windows.Forms.TabPage offlineJobsTabPage;
     1152    private System.Windows.Forms.TabPage calculatingJobTabPage;
     1153    private System.Windows.Forms.SplitContainer splitContainer2;
     1154    private System.Windows.Forms.Button btn_finishedJob_next;
     1155    private System.Windows.Forms.Button btn_finishedJob_prev;
     1156    private System.Windows.Forms.ComboBox cmb_finishedJob_count;
     1157    private System.Windows.Forms.ListView lv_finishedJobs;
     1158    private System.Windows.Forms.SplitContainer splitContainer3;
     1159    private System.Windows.Forms.ComboBox comboBox1;
     1160    private System.Windows.Forms.Button button1;
     1161    private System.Windows.Forms.Button button2;
     1162    private System.Windows.Forms.ListView listView1;
     1163    private System.Windows.Forms.SplitContainer splitContainer5;
     1164    private System.Windows.Forms.ComboBox cmb_calculatingJob_count;
     1165    private System.Windows.Forms.Button btn_calculatingJobs_next;
     1166    private System.Windows.Forms.Button btn_calculatingJobs_prev;
     1167    private System.Windows.Forms.ListView lv_calculatingJobs;
     1168    private System.Windows.Forms.SplitContainer splitContainer4;
     1169    private System.Windows.Forms.ComboBox cmb_offlineJob_count;
     1170    private System.Windows.Forms.Button btn_offlineJob_next;
     1171    private System.Windows.Forms.Button btn_offlinejob_prev;
     1172    private System.Windows.Forms.ListView lv_offlineJobs;
     1173    private System.Windows.Forms.ContextMenuStrip AbortContextMenuStrip;
     1174    private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
     1175    private System.Windows.Forms.ToolStripMenuItem calcToolStripAbortItem;
    7811176  }
    7821177}
  • branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs

    r3931 r4042  
    4444  public delegate void closeForm(bool cf, bool error);
    4545
     46  public delegate void updateListView(JobDataFetcher fetcher, ListView sender, int category);
     47
    4648  public partial class HiveServerManagementConsole : Form {
    4749
     
    6567    private TreeNode hoverNode;
    6668    private List<ListViewGroup> lvClientGroups;
     69
     70    private JobDataFetcher jdfFinished = null;
     71    private JobDataFetcher jdfOffline = null;
     72    private JobDataFetcher jdfCalculating = null;
     73   
     74     
    6775    #endregion
    6876
     
    8593      Init();
    8694      AddClients();
    87       AddJobs();
    88       timerSyncronize.Start();
    89     }
    90 
     95      //AddJobs();
     96      StartAutoUpdateTimers();
     97      //timerSyncronize.Start();
     98    }
     99
     100    private void StartAutoUpdateTimers() {
     101      jdfCalculating.NewDataAvailable += new EventHandler(jdf_NewDataAvailable);
     102      jdfOffline.NewDataAvailable += new EventHandler(jdf_NewDataAvailable);
     103      jdfFinished.NewDataAvailable += new EventHandler(jdf_NewDataAvailable);
     104      jdfFinished.Start();
     105      jdfOffline.Start();
     106      jdfCalculating.Start();
     107    }
     108
     109    void jdf_NewDataAvailable(object sender, EventArgs e) {
     110      JobDataFetcher fetcher = (JobDataFetcher) sender;
     111      if (fetcher.PollStates.Contains(State.finished)) {
     112        updateJobListView(fetcher, lv_finishedJobs, 0);
     113      } else if(fetcher.PollStates.Contains(State.calculating)) {
     114        updateJobListView(fetcher, lv_calculatingJobs, 1);
     115      } else if (fetcher.PollStates.Contains(State.offline)) {
     116        updateJobListView(fetcher, lv_offlineJobs, 2);
     117      }
     118    }
     119
     120    private void updateJobListView(JobDataFetcher fetcher, ListView listView, int category) {
     121      if (listView.InvokeRequired) {
     122        listView.Invoke(new updateListView(updateJobListView), new object[] { fetcher, listView, category });
     123      } else {
     124        listView.BeginUpdate();
     125        listView.Items.Clear();
     126        foreach (JobDto job in fetcher.CachedJobs) {
     127          ListViewItem lvi = new ListViewItem(job.Id.ToString(), category);
     128          lvi.Tag = job;
     129          listView.Items.Add(lvi);
     130        }
     131        listView.EndUpdate();
     132      }
     133    }
     134
     135   
    91136    private void Init() {
    92       //adding context menu items for jobs
    93       menuItemAbortJob.Click += (s, e) => {
    94         IJobManager jobManager = ServiceLocator.GetJobManager();
    95         if (lvJobControl.SelectedItems.Count == 1) {
    96           jobManager.AbortJob(((JobDto)(lvJobControl.SelectedItems[0].Tag)).Id);
     137
     138      jdfFinished = new JobDataFetcher(new State[] {State.finished}, 50);
     139      jdfCalculating = new JobDataFetcher(new State[] {State.calculating}, 50);
     140      jdfOffline = new JobDataFetcher(new State[] {State.offline}, 50);
     141
     142      cmb_finishedJob_count.SelectedItem = "50";
     143      cmb_offlineJob_count.SelectedItem = "50";
     144      cmb_calculatingJob_count.SelectedItem = "50";
     145     
     146      calcToolStripAbortItem.Click += (s, e) => {
     147        if(lv_calculatingJobs.SelectedItems.Count > 0) {
     148          ServiceLocator.GetJobManager().AbortJob(((JobDto) lv_calculatingJobs.SelectedItems[0].Tag).Id);
    97149        }
    98150      };
    99151
    100       //adding context menu items for jobs
    101       menuItemGetSnapshot.Click += (s, e) => {
    102         IJobManager jobManager = ServiceLocator.GetJobManager();
    103         if (lvJobControl.SelectedItems.Count == 1) {
    104           jobManager.RequestSnapshot(((JobDto)(lvJobControl.SelectedItems[0].Tag)).Id);
     152      offlineItemAbortJob.Click += (s, e) => {
     153        if (lv_offlineJobs.SelectedItems.Count > 0) {
     154          ServiceLocator.GetJobManager().AbortJob(((JobDto)lv_offlineJobs.SelectedItems[0].Tag).Id);
    105155        }
    106156      };
     
    256306
    257307
    258     /// <summary>
    259     /// Adds Exceptionobs to ListView and TreeView
    260     /// </summary>
    261     private void AddJobs() {
    262       try {
    263         List<ListViewItem> jobObjects = new List<ListViewItem>();
    264         IJobManager jobManager =
    265           ServiceLocator.GetJobManager();
    266         if (jobManager == null) {
    267           Logger.Error("Jobmanager is null");
    268           jobs = new ResponseList<JobDto>();
    269         } else {
    270           jobs = jobManager.GetAllJobs();
    271         }
    272 
    273 
    274         if (lvJobControl != null) lvJobControl.Items.Clear();
    275 
    276         ListViewGroup lvJobCalculating = new ListViewGroup("calculating", HorizontalAlignment.Left);
    277         ListViewGroup lvJobFinished = new ListViewGroup("finished", HorizontalAlignment.Left);
    278         ListViewGroup lvJobPending = new ListViewGroup("pending", HorizontalAlignment.Left);
    279 
    280         jobGroup = new List<ListViewGroup>();
    281         jobGroup.Add(lvJobCalculating);
    282         jobGroup.Add(lvJobFinished);
    283         jobGroup.Add(lvJobPending);
    284 
    285         if (jobs != null && jobs.List != null) {
    286 
    287           foreach (JobDto job in jobs.List) {
    288             if (job.State == State.calculating) {
    289               ListViewItem lvi = new ListViewItem(job.Id.ToString(), 1, lvJobCalculating);
    290               lvi.Tag = job;
    291               jobObjects.Add(lvi);
    292 
    293               lvi.ToolTipText = (job.Percentage * 100) + "% of job calculated";
    294             } else if (job.State == State.finished) {
    295               ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobFinished);
    296               lvi.Tag = job;
    297               jobObjects.Add(lvi);
    298             } else if (job.State == State.offline || job.State == State.pending) {
    299               ListViewItem lvi = new ListViewItem(job.Id.ToString(), 2, lvJobPending);
    300               lvi.Tag = job;
    301               jobObjects.Add(lvi);
    302             }
    303           } // Jobs
    304           lvJobControl.BeginUpdate();
    305           foreach (ListViewItem lvi in jobObjects) {
    306             lvJobControl.Items.Add(lvi);
    307           }
    308           // actualization
    309           lvJobControl.Groups.Add(lvJobCalculating);
    310           lvJobControl.Groups.Add(lvJobFinished);
    311           lvJobControl.Groups.Add(lvJobPending);
    312           lvJobControl.EndUpdate();
    313 
    314           if (currentJob != null) {
    315             JobClicked();
    316           }
    317         }
    318       }
    319       catch (Exception ex) {
    320         Logger.Error(ex);
    321         closeFormEvent(true, true);
    322         this.Close();
    323       }
    324     }
    325 
    326308    private void AddClients() {
    327309      lvClientGroups = new List<ListViewGroup>();
     
    543525
    544526    private void RefreshJob(Changes change) {
    545       if (change.ChangeType == Change.Update) {
     527      /*if (change.ChangeType == Change.Update) {
    546528        for (int i = 0; i < lvJobControl.Items.Count; i++) {
    547529          if (lvJobControl.Items[i].Text == change.ID.ToString()) {
     
    591573          }
    592574        }
    593       }
     575      }                    */
    594576    }
    595577
     
    626608
    627609    private void OnLVJobControlClicked(object sender, EventArgs e) {
    628       currentJob = (JobDto)lvJobControl.SelectedItems[0].Tag;
     610      JobListView jlv = (JobListView) sender;
     611      currentJob = (JobDto)jlv.SelectedItems[0].Tag;
    629612      JobClicked();
    630613    }
    631614
    632615    private void lvJobControl_MouseMove(object sender, MouseEventArgs e) {
    633       if ((lvJobControl.GetItemAt(e.X, e.Y) != null) &&
    634         (lvJobControl.GetItemAt(e.X, e.Y).ToolTipText != null)) {
    635         tt.SetToolTip(lvJobControl, lvJobControl.GetItemAt(e.X, e.Y).ToolTipText);
     616      JobListView jlv = (JobListView) sender;
     617      if ((jlv.GetItemAt(e.X, e.Y) != null) &&
     618        (jlv.GetItemAt(e.X, e.Y).ToolTipText != null)) {
     619        tt.SetToolTip(jlv, jlv.GetItemAt(e.X, e.Y).ToolTipText);
    636620      }
    637621    }
     
    640624      // If the right mouse button was clicked and released,
    641625      // display the shortcut menu assigned to the ListView.
    642       lvJobControl.ContextMenuStrip.Items.Clear();
    643       ListViewHitTestInfo hitTestInfo = lvJobControl.HitTest(e.Location);
    644       if (e.Button == MouseButtons.Right && hitTestInfo.Item != null && lvJobControl.SelectedItems.Count == 1) {
    645         JobDto selectedJob = (JobDto)lvJobControl.SelectedItems[0].Tag;
     626      JobListView jlv = (JobListView)sender;
     627      jlv.ContextMenuStrip.Items.Clear();
     628      ListViewHitTestInfo hitTestInfo = jlv.HitTest(e.Location);
     629      if (e.Button == MouseButtons.Right && hitTestInfo.Item != null && jlv.SelectedItems.Count == 1) {
     630        JobDto selectedJob = (JobDto)jlv.SelectedItems[0].Tag;
    646631
    647632        if (selectedJob != null && selectedJob.State == State.calculating) {
    648           lvJobControl.ContextMenuStrip.Items.Add(menuItemAbortJob);
    649           lvJobControl.ContextMenuStrip.Items.Add(menuItemGetSnapshot);
    650         }
    651       }
    652       lvJobControl.ContextMenuStrip.Show(new Point(e.X, e.Y));
     633          jlv.ContextMenuStrip.Items.Add(offlineItemAbortJob);
     634          jlv.ContextMenuStrip.Items.Add(menuItemGetSnapshot);
     635        }
     636      }
     637      jlv.ContextMenuStrip.Show(new Point(e.X, e.Y));
    653638    }
    654639
     
    745730    private void largeIconsToolStripMenuItem_Click(object sender, EventArgs e) {
    746731      lvClientControl.View = View.LargeIcon;
    747       lvJobControl.View = View.LargeIcon;
     732      //lvJobControl.View = View.LargeIcon;
    748733      largeIconsToolStripMenuItem.CheckState = CheckState.Checked;
    749734      smallIconsToolStripMenuItem.CheckState = CheckState.Unchecked;
     
    753738    private void smallIconsToolStripMenuItem_Click(object sender, EventArgs e) {
    754739      lvClientControl.View = View.SmallIcon;
    755       lvJobControl.View = View.SmallIcon;
     740      //lvJobControl.View = View.SmallIcon;
    756741      largeIconsToolStripMenuItem.CheckState = CheckState.Unchecked;
    757742      smallIconsToolStripMenuItem.CheckState = CheckState.Checked;
     
    761746    private void listToolStripMenuItem_Click(object sender, EventArgs e) {
    762747      lvClientControl.View = View.List;
    763       lvJobControl.View = View.List;
     748      //lvJobControl.View = View.List;
    764749      largeIconsToolStripMenuItem.CheckState = CheckState.Unchecked;
    765750      smallIconsToolStripMenuItem.CheckState = CheckState.Unchecked;
     
    859844    #endregion
    860845
    861 
    862 
     846    private void btn_prev_Click(object sender, EventArgs e) {
     847      if (sender == btn_finishedJob_prev)
     848        jdfFinished.Backward();
     849      else if (sender == btn_calculatingJobs_prev)
     850        jdfCalculating.Backward();
     851      else if (sender == btn_offlinejob_prev) {
     852        jdfOffline.Backward();
     853      }
     854    }
     855
     856    private void btn_next_Click(object sender, EventArgs e) {
     857      if (sender == btn_finishedJob_next)
     858        jdfFinished.Forward();
     859      else if (sender == btn_calculatingJobs_next)
     860        jdfCalculating.Forward();
     861      else if (sender == btn_offlineJob_next) {
     862        jdfOffline.Forward();
     863      }
     864    }
     865
     866    private void cmb_count_SelectedIndexChanged(object sender, EventArgs e) {
     867      ComboBox box = (ComboBox) sender;
     868      if (box.SelectedItem != null) {
     869        int val;
     870        if (Int32.TryParse(box.SelectedItem.ToString(), out val)) {
     871          if (box == cmb_offlineJob_count) {
     872            jdfOffline.NrOfEntriesOnPage = val;
     873          }
     874          else if (box == cmb_finishedJob_count) {
     875            jdfFinished.NrOfEntriesOnPage = val;
     876          }
     877          else if (box == cmb_calculatingJob_count) {
     878            jdfCalculating.NrOfEntriesOnPage = val;
     879          }
     880        }
     881      }
     882    }
     883
     884    private void lv_Jobs_SelectedIndexChanged(object sender, EventArgs e) {
     885      ListView lv = (ListView) sender;
     886      if(lv.SelectedItems.Count > 0) {
     887        foreach (ListViewItem lvi in lv.SelectedItems) {
     888          currentJob = (JobDto) lvi.Tag;
     889          JobClicked();         
     890        }
     891      }
     892    }
    863893  }
    864894}
  • branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.resx

    r3578 r4042  
    129129        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
    130130        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABo
    131         FwAAAk1TRnQBSQFMAgEBBAEAARQBAAEUAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
     131        FwAAAk1TRnQBSQFMAgEBBAEAAXQBAAF0AQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
    132132        AwABgAMAAUADAAEBAQABCAYAASAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
    133133        AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
     
    239239        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
    240240        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAO
    241         DgAAAk1TRnQBSQFMAgEBAwEAARQBAAEUAQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
     241        DgAAAk1TRnQBSQFMAgEBAwEAAXQBAAF0AQABIAEAASABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
    242242        AwABgAMAASADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
    243243        AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
     
    308308    <value>462, 9</value>
    309309  </metadata>
    310   <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    311   <data name="btnRefresh.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     310  <metadata name="updaterWoker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     311    <value>286, 48</value>
     312  </metadata>
     313  <metadata name="contextMenuJob.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     314    <value>144, 48</value>
     315  </metadata>
     316  <metadata name="ilSmallImgJob.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     317    <value>17, 48</value>
     318  </metadata>
     319  <data name="ilSmallImgJob.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
    312320    <value>
    313         iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    314         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAABcQQAA
    315         XEEBRtDlPgAAA3hJREFUSEu1ls1PE2EQxj229ouPVNErgZOJicZDjR68mHg1JgYvxov/gIlHxARBoxGU
    316         KlJUVJDypVIQKkXBpIootoC0tLS0pZEIiILfikAfZ5Zuu9sWaDQ2edLt7vvOrzPzzsxuALBBquIeRR7p
    317         CKmQVJSmeC3vyUu0FzNOD3NIFhJYpU8VuGBXpiVeK+6L2sgRQQKAbm4hTZ/pVcA8ooN9Ug/H7GY4Z3PS
    318         Eq/lPbyXbbAttsm2RUB7CT3oDmXj+Ts9uiay0B7IQFtU7YFMPAxmoiMUl5WurRMrsoWz0DuZjb4pPWxk
    319         g20RoF0A0EU+u2d2aWEZz8Adlxq3R9SodWlQ59bg7qgG9SSzR4tGrxZNYytqId3z6XDfr8MDUuu4Dhb6
    320         Q7ZwJupHtGLI8hlQwG7xhpo3atwi4wz4F4g1lCGGqoABhWXPlbgxrBa0HqTBqyMPWHFPXk4dRXd4p8yT
    321         8j4le1HIgCLjSyWuD6nWhNhC+zHz3Y6lyHcsR35h7qcDg+9PwjdvpFADT8J7ZeEyOVQMOCUAKghgGlSt
    322         Cnk2eVwwstbncXiPLCfVzo1xwOV+JaqcqpSQNr8BXxYCGJw5ja7gflj82zEwfQIRLMp43QSQJt7kkAAu
    323         EeBaFFAtCdVNSnpHYB+dpmwh6XeiJ8v94WKSMwxolpysKjlAIQBWg0hPVk/4ED4tePB5YUzQl99+fP0d
    324         wKOJXULiRYgMUN6vQCURRUidK5dCchZDM+fou5RUgqH3JRSiAzJPuEZYXCMNkhphSNVrSYjKXyhwhQAi
    325         pMW7OykEsz9eU6g2xWqEw9Xo3SoAUkGuJQKMdEOEJAI4oa0+AzgnHK5W3w54P5pgf3ssVu2JEBmgjDxg
    326         gAhp9hiSPFiOLODjz2H8WJwWnoU+tQhJFxOf6IkMcLFPgYqBFQCrKQqY/+XF9Ld+GSyCJbhnK1Drzlqz
    327         pVSSPbHQCs/bFbj0ShmDNI4a4J9rosLTC4k3u7fBFjxMST4I82huWi2lTNIqCoqp2RkH4pBKp07w5Kok
    328         8asVYurmqAbb5EYaa9eVBLhMXkg9+RtInVsNkyM24fJjA4db9t2RjagZ5tMUD1e6kFqaI40eNRrcKrFV
    329         rwycxJF5nbpg65gG1qCG2oQ2pk667gzKZaXfrK6QBm0+DW5QvlKOzCgkaeifp6HPWm/4rzv0/+dryx8H
    330         ysmLkjulowAAAABJRU5ErkJggg==
     321        AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
     322        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
     323        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABq
     324        CQAAAk1TRnQBSQFMAgEBAwEAAXQBAAF0AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
     325        AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
     326        AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
     327        AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
     328        AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
     329        AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
     330        AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
     331        ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
     332        AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
     333        AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
     334        AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
     335        AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
     336        AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
     337        AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
     338        AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
     339        AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
     340        ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
     341        Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
     342        AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
     343        AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
     344        AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
     345        ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
     346        Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
     347        AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
     348        AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
     349        AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
     350        AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
     351        AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
     352        AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wMAAWwKNgE1AaEDAAHH
     353        C6wBoQMAAWcLTQGhEgABUAE2AjcCNgY3AjYBoQEAAqwC2wfVAdsB1AGsAaEBAAFMAU0CWQJTBlkBUwFN
     354        AaEQAAGhDjYBNQGhAawN1AGsAaEBTQFTAk0KUwFNEAABbA82AccO1AGsAYwBUwJNC1MBTRAAAWwGNgFX
     355        CDYBxwTUAdwJ1AGsAWcCTQJTAZoB/wGaAVMC/wRTAU0QAAFsBTYBGwH/CDYBxwTUAv8B3AfUAawBZwFN
     356        A1MBmgH/ARoBUwL/BFMBTRAAAWwENgFYAv8B9gc2AccE1AT/AdwF1AGsAWcEUwGaAf8BGgFTAv8EUwFN
     357        EAABbAQ2Af8B9gE2Af8BnwY2AccE1Ab/AdsD1AGsAWcEUwGaAf8BGgFTAv8EUwFNEAABbAQ2AXkCNgFY
     358        Af8BWAU2AccE1AT/AfQF1AGsAWcEUwGaAf8BGgFTAv8EUwFNEAABbAg2ARsB/wU2AccE1AP/B9QBrAFn
     359        BFMBmgH/ARoBUwL/BFMBTRAAAWwJNgH/AZ8ENgHHBNQB/wnUAawBZwRTAXUBGgF6AVMCGgRTAU0QAAFs
     360        DTYBNwE2AccO1AGsAWcOUwFNEAABhgw2AjcBNgHHAa0M1AHbAawBhg5TAU0RAAE2DDcBNgFsAQABrAHV
     361        AdsI1ALbAawBxwEAAU0CeglTAXoBTQFnEQABoQM2BzcCNgFQAgABoQKsAbMH1AGzAqwCAAHEAk0JUwFN
     362        AUwUAAGGCWwBoQUACscBoQUAAYYIZwGMAaESAAFCAU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUA
     363        AYAXAAP/AQABwAEBAcABAQHAAQECAAGAAQABgAEAAYBbAAGAAQABgAEAAYADAAGAAQEBgAEBAYABAQIA
     364        AeABAwHgAQMB4AEDAgAL
    331365</value>
    332366  </data>
    333   <metadata name="contextMenuGroup.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    334     <value>504, 38</value>
     367  <metadata name="AbortContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     368    <value>621, 9</value>
    335369  </metadata>
    336370  <metadata name="ilSmallImgClient.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    337     <value>17, 50</value>
     371    <value>961, 9</value>
    338372  </metadata>
    339373  <data name="ilSmallImgClient.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
     
    342376        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
    343377        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABy
    344         DAAAAk1TRnQBSQFMAgEBBAEAARQBAAEUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
     378        DAAAAk1TRnQBSQFMAgEBBAEAAXQBAAF0AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
    345379        AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
    346380        AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
     
    398432</value>
    399433  </data>
    400   <metadata name="contextMenuJob.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    401     <value>246, 40</value>
    402   </metadata>
    403   <metadata name="ilSmallImgJob.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    404     <value>137, 50</value>
    405   </metadata>
    406   <data name="ilSmallImgJob.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
     434  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     435  <data name="btnRefresh.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    407436    <value>
    408         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
    409         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
    410         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABq
    411         CQAAAk1TRnQBSQFMAgEBAwEAARQBAAEUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
    412         AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
    413         AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
    414         AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
    415         AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
    416         AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
    417         AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
    418         ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
    419         AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
    420         AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
    421         AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
    422         AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
    423         AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
    424         AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
    425         AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
    426         AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
    427         ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
    428         Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
    429         AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
    430         AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
    431         AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
    432         ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
    433         Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
    434         AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
    435         AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
    436         AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
    437         AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
    438         AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
    439         AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wMAAWwKNgE1AaEDAAHH
    440         C6wBoQMAAWcLTQGhEgABUAE2AjcCNgY3AjYBoQEAAqwC2wfVAdsB1AGsAaEBAAFMAU0CWQJTBlkBUwFN
    441         AaEQAAGhDjYBNQGhAawN1AGsAaEBTQFTAk0KUwFNEAABbA82AccO1AGsAYwBUwJNC1MBTRAAAWwGNgFX
    442         CDYBxwTUAdwJ1AGsAWcCTQJTAZoB/wGaAVMC/wRTAU0QAAFsBTYBGwH/CDYBxwTUAv8B3AfUAawBZwFN
    443         A1MBmgH/ARoBUwL/BFMBTRAAAWwENgFYAv8B9gc2AccE1AT/AdwF1AGsAWcEUwGaAf8BGgFTAv8EUwFN
    444         EAABbAQ2Af8B9gE2Af8BnwY2AccE1Ab/AdsD1AGsAWcEUwGaAf8BGgFTAv8EUwFNEAABbAQ2AXkCNgFY
    445         Af8BWAU2AccE1AT/AfQF1AGsAWcEUwGaAf8BGgFTAv8EUwFNEAABbAg2ARsB/wU2AccE1AP/B9QBrAFn
    446         BFMBmgH/ARoBUwL/BFMBTRAAAWwJNgH/AZ8ENgHHBNQB/wnUAawBZwRTAXUBGgF6AVMCGgRTAU0QAAFs
    447         DTYBNwE2AccO1AGsAWcOUwFNEAABhgw2AjcBNgHHAa0M1AHbAawBhg5TAU0RAAE2DDcBNgFsAQABrAHV
    448         AdsI1ALbAawBxwEAAU0CeglTAXoBTQFnEQABoQM2BzcCNgFQAgABoQKsAbMH1AGzAqwCAAHEAk0JUwFN
    449         AUwUAAGGCWwBoQUACscBoQUAAYYIZwGMAaESAAFCAU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUA
    450         AYAXAAP/AQABwAEBAcABAQHAAQECAAGAAQABgAEAAYBbAAGAAQABgAEAAYADAAGAAQEBgAEBAYABAQIA
    451         AeABAwHgAQMB4AEDAgAL
     437        iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
     438        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAABcPgAA
     439        XD4BFAM/EwAAA3hJREFUSEu1ls1PE2EQxj229ouPVNErgZOJicZDjR68mHg1JgYvxov/gIlHxARBoxGU
     440        KlJUVJDypVIQKkXBpIootoC0tLS0pZEIiILfikAfZ5Zuu9sWaDQ2edLt7vvOrzPzzsxuALBBquIeRR7p
     441        CKmQVJSmeC3vyUu0FzNOD3NIFhJYpU8VuGBXpiVeK+6L2sgRQQKAbm4hTZ/pVcA8ooN9Ug/H7GY4Z3PS
     442        Eq/lPbyXbbAttsm2RUB7CT3oDmXj+Ts9uiay0B7IQFtU7YFMPAxmoiMUl5WurRMrsoWz0DuZjb4pPWxk
     443        g20RoF0A0EU+u2d2aWEZz8Adlxq3R9SodWlQ59bg7qgG9SSzR4tGrxZNYytqId3z6XDfr8MDUuu4Dhb6
     444        Q7ZwJupHtGLI8hlQwG7xhpo3atwi4wz4F4g1lCGGqoABhWXPlbgxrBa0HqTBqyMPWHFPXk4dRXd4p8yT
     445        8j4le1HIgCLjSyWuD6nWhNhC+zHz3Y6lyHcsR35h7qcDg+9PwjdvpFADT8J7ZeEyOVQMOCUAKghgGlSt
     446        Cnk2eVwwstbncXiPLCfVzo1xwOV+JaqcqpSQNr8BXxYCGJw5ja7gflj82zEwfQIRLMp43QSQJt7kkAAu
     447        EeBaFFAtCdVNSnpHYB+dpmwh6XeiJ8v94WKSMwxolpysKjlAIQBWg0hPVk/4ED4tePB5YUzQl99+fP0d
     448        wKOJXULiRYgMUN6vQCURRUidK5dCchZDM+fou5RUgqH3JRSiAzJPuEZYXCMNkhphSNVrSYjKXyhwhQAi
     449        pMW7OykEsz9eU6g2xWqEw9Xo3SoAUkGuJQKMdEOEJAI4oa0+AzgnHK5W3w54P5pgf3ssVu2JEBmgjDxg
     450        gAhp9hiSPFiOLODjz2H8WJwWnoU+tQhJFxOf6IkMcLFPgYqBFQCrKQqY/+XF9Ld+GSyCJbhnK1Drzlqz
     451        pVSSPbHQCs/bFbj0ShmDNI4a4J9rosLTC4k3u7fBFjxMST4I82huWi2lTNIqCoqp2RkH4pBKp07w5Kok
     452        8asVYurmqAbb5EYaa9eVBLhMXkg9+RtInVsNkyM24fJjA4db9t2RjagZ5tMUD1e6kFqaI40eNRrcKrFV
     453        rwycxJF5nbpg65gG1qCG2oQ2pk667gzKZaXfrK6QBm0+DW5QvlKOzCgkaeifp6HPWm/4rzv0/+dryx8H
     454        ysmLkjulowAAAABJRU5ErkJggg==
    452455</value>
    453456  </data>
    454   <metadata name="updaterWoker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    455     <value>388, 41</value>
     457  <metadata name="contextMenuGroup.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     458    <value>803, 9</value>
    456459  </metadata>
    457460</root>
  • branches/3.2/sources/HeuristicLab.Hive.Server.Console/3.2/ServiceLocator.cs

    r2118 r4042  
    3434                         
    3535        serverConsoleFacade = factory.CreateChannel();
     36        ((ICommunicationObject)serverConsoleFacade).Faulted += ServiceLocator_Faulted;
    3637      }
    3738     
    3839      return serverConsoleFacade;
     40    }
     41
     42    static void ServiceLocator_Faulted(object sender, EventArgs e) {
     43      ((ICommunicationObject)serverConsoleFacade).Abort();
     44      ((ICommunicationObject)serverConsoleFacade).Faulted -= ServiceLocator_Faulted;
     45      serverConsoleFacade = null;
    3946    }
    4047
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs

    r3931 r4042  
    725725            CachedHivePluginInfoDto currCachedPlugin = new CachedHivePluginInfoDto {
    726726              Name = currPlugin.Name,
    727               Version = currPlugin.Version.ToString(),
     727              Version = currPlugin.Version,
    728728              BuildDate = currPlugin.BuildDate
    729729            };
    730730
    731731            foreach (string fileName in from file in currPlugin.Files select file.Name) {
    732               currCachedPlugin.PluginFiles.Add(File.ReadAllBytes(fileName));
     732              currCachedPlugin.PluginFiles.Add(new HivePluginFile(File.ReadAllBytes(fileName), fileName));
    733733            }
    734734            response.Plugins.Add(currCachedPlugin);
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientFacade.cs

    r3931 r4042  
    100100    #region IClientFacade Members
    101101
     102    [SpringTransaction(UserTransaction = true)]
    102103    public Stream SendStreamedJob(Guid clientId) {
    103104      MultiStream stream =
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/DefaultScheduler.cs

    r3018 r4042  
    88using System.Threading;
    99using HeuristicLab.DataAccess.Interfaces;
     10using System.Transactions;
     11using HeuristicLab.Hive.Contracts;
    1012
    1113namespace HeuristicLab.Hive.Server.Core {
     
    3234      /// Critical section ///
    3335      jobLock.WaitOne();
    34 
    35       ClientDto client = DaoLocator.ClientDao.FindById(clientId);
    36       LinkedList<JobDto> allOfflineJobsForClient =
    37         new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, client.NrOfFreeCores,
    38                                                                           client.FreeMemory, client.Id));
    39 
    4036      JobDto jobToCalculate = null;
    41       if (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0) {
    42         jobToCalculate = allOfflineJobsForClient.First.Value;
    43         jobToCalculate.State = State.calculating;
    44         jobToCalculate.Client = client;
    45         jobToCalculate.Client.State = State.calculating;
    46         jobToCalculate.DateCalculated = DateTime.Now;
    47         DaoLocator.JobDao.AssignClientToJob(client.Id, jobToCalculate.Id);
    48         DaoLocator.JobDao.Update(jobToCalculate);
    49         DaoLocator.ClientDao.Update(jobToCalculate.Client);
     37      using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
     38        ClientDto client = DaoLocator.ClientDao.FindById(clientId);
     39        LinkedList<JobDto> allOfflineJobsForClient =
     40          new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobsForClient(State.offline, client.NrOfFreeCores,
     41                                                                            client.FreeMemory, client.Id));       
     42        if (allOfflineJobsForClient != null && allOfflineJobsForClient.Count > 0) {
     43          jobToCalculate = allOfflineJobsForClient.First.Value;
     44          jobToCalculate.State = State.calculating;
     45          jobToCalculate.Client = client;
     46          jobToCalculate.Client.State = State.calculating;
     47          jobToCalculate.DateCalculated = DateTime.Now;
     48          DaoLocator.JobDao.AssignClientToJob(client.Id, jobToCalculate.Id);
     49          DaoLocator.JobDao.Update(jobToCalculate);
     50          DaoLocator.ClientDao.Update(jobToCalculate.Client);
     51        }
     52        scope.Complete();
    5053      }
    5154      jobLock.ReleaseMutex();
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ExecutionEngineFacade.cs

    r3220 r4042  
    5353
    5454    public ResponseObject<SerializedJob>
    55       GetLastSerializedResult(Guid jobId, bool requested) {
    56       return jobManager.GetLastSerializedJobResultOf(jobId, requested);
     55      GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) {
     56      return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
    5757    }
    5858
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/HeuristicLab.Hive.Server.Core-3.2.csproj

    r3011 r4042  
    120120    </Compile>
    121121    <Compile Include="Settings.cs" />
     122    <Compile Include="SpringTransaction.cs" />
    122123  </ItemGroup>
    123124  <ItemGroup>
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/JobManager.cs

    r3931 r4042  
    105105      ResponseList<JobDto> response = new ResponseList<JobDto>();
    106106      response.List = new List<JobDto>(DaoLocator.JobDao.FindWithLimitations(jobState, offset, count));
     107      response.Success = true;
    107108      return response;
    108109    }
     
    237238    }
    238239
     240    //Requested means: there MUST be a job result which gets sent back
    239241    public ResponseObject<SerializedJob>
    240       GetLastSerializedJobResultOf(Guid jobId, bool requested) {
     242      GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot) {
    241243      ResponseObject<SerializedJob> response =
    242244        new ResponseObject<SerializedJob>();
    243245
    244246      JobDto job = DaoLocator.JobDao.FindById(jobId);
    245       if (requested && (job.State == State.requestSnapshot || job.State == State.requestSnapshotSent)) {
     247
     248      //if it's a snapshot but the result hasn't reached the server yet...
     249      if (snapshot && (job.State == State.requestSnapshot || job.State == State.requestSnapshotSent)) {
    246250        response.Success = true;
    247251        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE;
     
    250254      }
    251255
     256      //if it's NOT a snapshot, NEITHER request NOR is it finished
     257      if(!requested && !snapshot && job.State != State.finished) {     
     258        response.Success = true;
     259        response.StatusMessage = ApplicationConstants.RESPONSE_JOB_RESULT_NOT_YET_HERE;
     260
     261        return response;
     262      }
     263
     264      //every other case - snapshot, job finished or it's requested
    252265      response.Success = true;
    253266      response.StatusMessage = ApplicationConstants.RESPONSE_JOB_JOB_RESULT_SENT;
    254267      response.Obj = new SerializedJob();
    255268      response.Obj.JobInfo = job;
     269
    256270      response.Obj.SerializedJobData =
    257271        DaoLocator.JobDao.GetBinaryJobFile(jobId);
     272
    258273      return response;
    259274    }
  • branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ServerConsoleFacade.cs

    r3578 r4042  
    122122    }
    123123
    124     public ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested) {
     124    public ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot) {
    125125      secMan.Authorize("AccessJobResults", sessionID, jobId);
    126       return jobManager.GetLastSerializedJobResultOf(jobId, requested);
     126      return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
    127127    }
    128128
  • branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/BaseDao.cs

    r3931 r4042  
    1919        Context.SubmitChanges(ConflictMode.ContinueOnConflict);
    2020      } catch (ChangeConflictException e) {
     21       
    2122        Logger.Warn("Concurrency Exception! " + e.Message);
    2223        foreach (ObjectChangeConflict conflict in Context.ChangeConflicts) {
     
    3031          conflict.Resolve(RefreshMode.KeepChanges);
    3132        }
    32         Context.SubmitChanges(ConflictMode.FailOnFirstConflict);
     33        //next round!
     34        CommitChanges();
     35        //Context.SubmitChanges(ConflictMode.FailOnFirstConflict);
    3336      }
    3437    }
  • branches/3.2/sources/HeuristicLab.Hive.Server.LINQDataAccess/3.2/PluginInfoDao.cs

    r3578 r4042  
    4343
    4444    public void InsertPluginDependenciesForJob(JobDto jobDto) {
    45       foreach (HivePluginInfoDto info in jobDto.PluginsNeeded) {       
     45      foreach (HivePluginInfoDto info in jobDto.PluginsNeeded) {               
    4646        PluginInfo dbpi =
    47           Context.PluginInfos.Where(pi => pi.Name.Equals(info.Name) && pi.Version == info.Version).SingleOrDefault();
     47          Context.PluginInfos.Where(pi => pi.Name.Equals(info.Name) && pi.Version == info.Version.ToString()).SingleOrDefault();
    4848        if (dbpi == null) {
    4949          dbpi = new PluginInfo {
    5050                                  BuildDate = info.BuildDate.ToString(),
    5151                                  Name = info.Name,
    52                                   Version = info.Version
     52                                  Version = info.Version.ToString()
    5353                                };
    5454          Context.PluginInfos.InsertOnSubmit(dbpi);
     
    8282      target.Name = source.Name;
    8383      target.PluginId = source.Id;
    84       target.Version = source.Version;     
     84      target.Version = source.Version.ToString();     
    8585
    8686      return target;
     
    9696      target.Name = source.Name;
    9797      target.Id = source.PluginId;
    98       target.Version = source.Version;
     98      target.Version = new Version(source.Version);
    9999
    100100      return target;
  • branches/3.2/sources/HeuristicLab.Hive.Server/3.2/MainForm.Designer.cs

    r2067 r4042  
    3737          this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
    3838          this.tsExit = new System.Windows.Forms.ToolStripMenuItem();
    39           this.btnClose = new System.Windows.Forms.Button();
    4039          this.ctxNotifyMenu.SuspendLayout();
    4140          this.SuspendLayout();
     
    7271            this.tsExit});
    7372          this.ctxNotifyMenu.Name = "ctxNotifyMenu";
    74           this.ctxNotifyMenu.Size = new System.Drawing.Size(106, 54);
     73          this.ctxNotifyMenu.Size = new System.Drawing.Size(96, 54);
    7574          //
    7675          // tsShowInfo
    7776          //
    7877          this.tsShowInfo.Name = "tsShowInfo";
    79           this.tsShowInfo.Size = new System.Drawing.Size(105, 22);
     78          this.tsShowInfo.Size = new System.Drawing.Size(95, 22);
    8079          this.tsShowInfo.Text = "&Info";
    8180          this.tsShowInfo.Click += new System.EventHandler(this.ShowInfo);
     
    8483          //
    8584          this.toolStripSeparator1.Name = "toolStripSeparator1";
    86           this.toolStripSeparator1.Size = new System.Drawing.Size(102, 6);
     85          this.toolStripSeparator1.Size = new System.Drawing.Size(92, 6);
    8786          //
    8887          // tsExit
    8988          //
    9089          this.tsExit.Name = "tsExit";
    91           this.tsExit.Size = new System.Drawing.Size(105, 22);
     90          this.tsExit.Size = new System.Drawing.Size(95, 22);
    9291          this.tsExit.Text = "E&xit";
    9392          this.tsExit.Click += new System.EventHandler(this.CloseApp);
    9493          //
    95           // btnClose
    96           //
    97           this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    98           this.btnClose.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
    99           this.btnClose.Location = new System.Drawing.Point(279, 1);
    100           this.btnClose.Name = "btnClose";
    101           this.btnClose.Size = new System.Drawing.Size(22, 21);
    102           this.btnClose.TabIndex = 2;
    103           this.btnClose.Text = "X";
    104           this.btnClose.UseVisualStyleBackColor = true;
    105           this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
    106           //
    10794          // MainForm
    10895          //
    109           this.AcceptButton = this.btnClose;
    11096          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    11197          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    112           this.CancelButton = this.btnClose;
    11398          this.ClientSize = new System.Drawing.Size(304, 166);
    114           this.ControlBox = false;
    115           this.Controls.Add(this.btnClose);
    11699          this.Controls.Add(this.rtfServices);
    117100          this.Controls.Add(this.label1);
    118           this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
     101          this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
    119102          this.Name = "MainForm";
    120           this.ShowInTaskbar = false;
    121103          this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    122104          this.Text = "Hive Server";
    123           this.TopMost = true;
     105          this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
    124106          this.ctxNotifyMenu.ResumeLayout(false);
    125107          this.ResumeLayout(false);
     
    137119        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
    138120        private System.Windows.Forms.ToolStripMenuItem tsExit;
    139         private System.Windows.Forms.Button btnClose;
    140121    }
    141122}
  • branches/3.2/sources/HeuristicLab.Hive.Server/3.2/MainForm.cs

    r2065 r4042  
    5050        }
    5151
     52        private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {         
     53        }
     54
    5255    }
    5356}
  • branches/3.2/sources/HeuristicLab.Hive.Server/3.2/ServiceCallInterception.cs

    r3931 r4042  
    99using HeuristicLab.Hive.Contracts;
    1010using HeuristicLab.Tracing;
     11using System.Reflection;
     12using HeuristicLab.Hive.Server.Core;
    1113
    1214namespace HeuristicLab.Hive.Server {
    1315  internal class ServiceCallInterception : IMethodInterceptor {
    14 
    1516    private const bool UseTransactions = true;
    1617
    1718    public object Invoke(IMethodInvocation invocation) {
     19      bool userTransaction = false;
     20
    1821      DateTime start = DateTime.Now;
    1922      Logger.Info("Entering Method: " + invocation.Method.Name);
    2023
    21       if(!ContextFactory.IsContextNull()) {
     24      if (!ContextFactory.IsContextNull()) {
    2225        Logger.Info("Not null context found - why wasn't this disposed?");
    2326        try {
    2427          Logger.Info("Trying to dispose");
    2528          ContextFactory.Context.Dispose();
    26         } catch (Exception e) {
     29        }
     30        catch (Exception e) {
    2731          Logger.Error(e);
    2832        }
     
    3034      }
    3135      Logger.Info("Context info: Timeout: " + ContextFactory.Context.Connection.ConnectionTimeout + " | " +
    32                   ContextFactory.Context.Connection.State + " | Conn: " + ContextFactory.Context + " | HashCode is: " + ContextFactory.Context.Connection.GetHashCode());
     36                  ContextFactory.Context.Connection.State + " | Conn: " + ContextFactory.Context + " | HashCode is: " +
     37                  ContextFactory.Context.Connection.GetHashCode());
    3338      Object obj = null;
    3439
    35       /*if (invocation.Method.Name.Equals("SendStreamedJob") || invocation.Method.Name.Equals("StoreFinishedJobResultStreamed")) {       
    36         ContextFactory.Context.Connection.Open();
    37         if(UseTransactions) {
    38           Logger.Debug("Opening Transaction");
    39           ContextFactory.Context.Transaction = ContextFactory.Context.Connection.BeginTransaction(ApplicationConstants.ISOLATION_LEVEL);
    40         } else {
    41           Logger.Debug("Not using a Transaction");
    42         }
    43         try {
    44           obj = invocation.Proceed();
    45           Logger.Info("leaving context open for streaming");
    46         }
    47         catch (Exception e) {
    48           Logger.Error("Exception occured during method invocation", e);             
    49           ContextFactory.Context.Dispose();
    50           ContextFactory.Context = null;
    51         }       
    52       } else { */
    53         if(UseTransactions) {
    54           using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
    55             try {
    56               Logger.Debug("Current Transaction Isolation level is: " + Transaction.Current.IsolationLevel);
    57               obj = invocation.Proceed();
    58               scope.Complete();
    59             }
    60             catch (Exception e) {
    61               Logger.Error("Exception occured during method invocation", e);     
    62               Logger.Error("Inner Exception: ", e.InnerException);
    63             }
    64             finally {
    65               ContextFactory.Context.Dispose();
    66               Logger.Debug("Disposed Context");
    67               ContextFactory.Context = null;
    68               Logger.Debug("Set Context Null");
    69             }
    70           }
    71         } else {
     40      Object[] attributes = invocation.Method.GetCustomAttributes(typeof (SpringTransaction), true);
     41      foreach (Object o in attributes) {
     42        SpringTransaction st = (SpringTransaction) o;
     43        userTransaction = st.UserTransaction;
     44      }
     45      if (UseTransactions && !userTransaction) {
     46        using (
     47          TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
     48                                                        new TransactionOptions
     49                                                        {IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE})) {
    7250          try {
    73             obj = invocation.Proceed();           
     51            Logger.Debug("Current Transaction Isolation level is: " + Transaction.Current.IsolationLevel);
     52            obj = invocation.Proceed();
     53            scope.Complete();
    7454          }
    7555          catch (Exception e) {
    76             Logger.Error("Exception occured during method invocation", e);                         
     56            Logger.Error("Exception occured during method invocation", e);
     57            Logger.Error("Inner Exception: ", e.InnerException);
    7758          }
    7859          finally {
     
    8162            ContextFactory.Context = null;
    8263            Logger.Debug("Set Context Null");
    83           } 
     64          }
    8465        }
     66      }
     67      else {
     68        try {
     69          obj = invocation.Proceed();
     70        }
     71        catch (Exception e) {
     72          Logger.Error("Exception occured during method invocation", e);
     73        }
     74        finally {
     75          ContextFactory.Context.Dispose();
     76          Logger.Debug("Disposed Context");
     77          ContextFactory.Context = null;
     78          Logger.Debug("Set Context Null");
     79        }
     80      }
    8581      //}       
    8682      TimeSpan ts = DateTime.Now - start;
    8783      if (ts.Seconds > 2) {
    8884        Logger.Warn("Invocation took: " + ts);
    89       } else if (ts.Seconds > 10) {
     85      }
     86      else if (ts.Seconds > 10) {
    9087        Logger.Error("Invocation took: " + ts);
    91       } else {
    92         Logger.Info("Invocation took: " + ts); ;
     88      }
     89      else {
     90        Logger.Info("Invocation took: " + ts);
     91        ;
    9392      }
    9493      Logger.Info("Leaving Method: " + invocation.Method.Name);
    95      
     94
    9695      return obj;
    9796    }
    9897  }
    9998}
    100      
    101  
  • branches/3.2/sources/HeuristicLab.PluginInfrastructure/Sandboxing/SandboxManager.cs

    r3578 r4042  
    6565
    6666      #region permission set for sandbox
    67       // Uncomment code for sandboxed appdomain
    68       //pset = new PermissionSet(PermissionState.None);
    69       //pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
    70       //pset.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess));
    71       //FileIOPermission fPerm = new FileIOPermission(PermissionState.None);
     67      //Uncomment code for sandboxed appdomain
     68      pset = new PermissionSet(PermissionState.None);
     69      pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
     70      pset.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.AllFlags));
     71      FileIOPermission fPerm = new FileIOPermission(PermissionState.None);
    7272
    73       //foreach (IPluginDescription plugin in ApplicationManager.Manager.Plugins) {
    74       //  fPerm.AddPathList(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, plugin.Files.ToArray());
    75       //}
     73      foreach (IPluginDescription plugin in ApplicationManager.Manager.Plugins) {
     74        foreach (IPluginFile pluginFile in plugin.Files) {
     75          fPerm.AddPathList(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, pluginFile.Name); 
     76          //fPerm.AddPathList(FileIOPermissionAccess.AllAccess, pluginFile.Name); 
     77        }       
     78      }
    7679
    77       //pset.AddPermission(fPerm);
     80      pset.AddPermission(fPerm);
    7881      #endregion
    7982
    8083      #region permission set of unrestricted appdomain
    8184      // unrestricted appdomain
    82       pset = new PermissionSet(PermissionState.Unrestricted);
     85      //pset = new PermissionSet(PermissionState.Unrestricted);
    8386      #endregion
    8487
     
    8689      //setup.PrivateBinPath = pluginDir;
    8790      setup.ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
    88       AppDomain applicationDomain = AppDomain.CreateDomain(name, AppDomain.CurrentDomain.Evidence, setup, pset, CreateStrongName(Assembly.GetExecutingAssembly()));
     91      AppDomain applicationDomain = AppDomain.CreateDomain(name, AppDomain.CurrentDomain.Evidence, setup, pset, new StrongName[] {CreateStrongName(Assembly.GetExecutingAssembly())});
     92
    8993      Type applicationManagerType = typeof(DefaultApplicationManager);
    9094      DefaultApplicationManager applicationManager =
     
    9397      PluginDescription[] plugins = ApplicationManager.Manager.Plugins.Cast<PluginDescription>().ToArray();
    9498      applicationManager.PrepareApplicationDomain(apps, plugins);
    95       //if (files != null && files.Count() > 0)
    96         //applicationManager.LoadAssemblies(files);
     99      if (files != null && files.Count() > 0)
     100        applicationManager.LoadAssemblies(files);
    97101      return applicationDomain;
    98102    }
Note: See TracChangeset for help on using the changeset viewer.