Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/15/09 14:46:57 (15 years ago)
Author:
kgrading
Message:

added licence information and comments (#467)

Location:
trunk/sources/HeuristicLab.Hive.Client.Core
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Core/ClientConsoleService/ClientConsoleCommunicator.cs

    r1085 r1132  
    1717        return ConfigManager.Instance.GetStatusForClientConsole();
    1818      }
    19     }
    20 
    21     public ConnectionContainer GetConnection() {
    22       return new ConnectionContainer{IPAdress = WcfService.Instance.ServerIP, Port = WcfService.Instance.ServerPort } ;
    2319    }
    2420
  • trunk/sources/HeuristicLab.Hive.Client.Core/ClientConsoleService/Interfaces/IClientConsoleCommunicator.cs

    r1083 r1132  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
     
    627
    728namespace HeuristicLab.Hive.Client.Core.ClientConsoleService.Interfaces {
     29  /// <summary>
     30  /// Defines the interfaces for the Client Console
     31  /// </summary>
    832  [ServiceContract]
    933  public interface IClientConsoleCommunicator {
     34    /// <summary>
     35    /// Gets all status information concerning the client Service
     36    /// </summary>
     37    /// <returns>the StatusCommons Object, filled with the client details</returns>
    1038    [OperationContract]
    1139    StatusCommons GetStatusInfos();
    12     [OperationContract]
    13     ConnectionContainer GetConnection();
     40    /// <summary>
     41    /// Set the connection settings in the wcfService
     42    /// </summary>
     43    /// <param name="container">the container with the connection details</param>
    1444    [OperationContract]
    1545    void SetConnection(ConnectionContainer container);
     46    /// <summary>
     47    /// Signals the client to disconnect from the server
     48    /// </summary>
    1649    [OperationContract]
    1750    void Disconnect();
     51    /// <summary>
     52    /// Get the current connection details
     53    /// </summary>
     54    /// <returns>the ConnectionContainer Object</returns>
    1855    [OperationContract]
    1956    ConnectionContainer GetCurrentConnection();
     57    /// <summary>
     58    /// Signals the client to exit all jobs and shutdown
     59    /// </summary>
    2060    [OperationContract]
    2161    void ShutdownClient();
  • trunk/sources/HeuristicLab.Hive.Client.Core/ClientConsoleService/TransferObjects/ConnectionContainer.cs

    r950 r1132  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
  • trunk/sources/HeuristicLab.Hive.Client.Core/ClientConsoleService/TransferObjects/JobStatus.cs

    r950 r1132  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
     
    829  [DataContract]
    930  public class JobStatus {
     31    /// <summary>
     32    /// Id of the Job
     33    /// </summary>
    1034    [DataMember]
    1135    public long JobId { get; set; }
     36    /// <summary>
     37    /// When has the calculation of the Job begun?
     38    /// </summary>
    1239    [DataMember]
    1340    public DateTime Since { get; set; }
     41    /// <summary>
     42    /// Current progress
     43    /// </summary>
    1444    [DataMember]
    1545    public double Progress { get; set; }
  • trunk/sources/HeuristicLab.Hive.Client.Core/ClientConsoleService/TransferObjects/StatusCommons.cs

    r950 r1132  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
     
    728
    829namespace HeuristicLab.Hive.Client.Core.ClientConsoleService {
     30  /// <summary>
     31  /// Various Status Information for the ClientConsole
     32  /// </summary>
    933  [DataContract]
    1034  public class StatusCommons {   
  • trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager/ConfigManager.cs

    r1119 r1132  
    5151    /// Constructor for the singleton, must recover Guid, Calendar, ...
    5252    /// </summary>
    53     private ConfigManager() {
    54       //retrive GUID from XML file, or burn in hell. as in hell. not heaven.
    55       //this won't work this way. We need a plugin for XML Handling.     
     53    private ConfigManager() {     
    5654      hardwareInfo = new ClientInfo();
    5755
     
    6866    }
    6967
     68    /// <summary>
     69    /// Get all the Information about the client
     70    /// </summary>
     71    /// <returns>the ClientInfo object</returns>
    7072    public ClientInfo GetClientInfo() {
    7173      hardwareInfo.Login = WcfService.Instance.ConnectedSince;
     
    7375    }
    7476
     77    /// <summary>
     78    /// Returns the connectioncontainer with the IP and Port, storred in the Settings framework
     79    /// </summary>
     80    /// <returns>The IP and Port of the server</returns>
    7581    public ConnectionContainer GetServerIPAndPort() {
    7682      ConnectionContainer cc = new ConnectionContainer();
     
    8086    }
    8187
     88    /// <summary>
     89    /// Sets and saves IP and Port in the Settings framework
     90    /// </summary>
     91    /// <param name="cc"></param>
    8292    public void SetServerIPAndPort(ConnectionContainer cc) {
    8393      Settings.Default.ServerIP = cc.IPAdress;
     
    8595      Settings.Default.Save();
    8696    }
    87 
     97    /// <summary>
     98    /// collects and returns information that get displayed by the Client Console
     99    /// </summary>
     100    /// <returns></returns>
    88101    public StatusCommons GetStatusForClientConsole() {
    89102      StatusCommons st = new StatusCommons();
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r1120 r1132  
    4646
    4747namespace HeuristicLab.Hive.Client.Core {
     48  /// <summary>
     49  /// The core component of the Hive Client
     50  /// </summary>
    4851  public class Core: MarshalByRefObject {
    4952    public delegate string GetASnapshotDelegate();
     
    5962    private WcfService wcfService;
    6063    private Heartbeat beat;
    61 
     64   
     65    /// <summary>
     66    /// Main Method for the client
     67    /// </summary>
    6268    public void Start() {
    6369      Core.Locker = new Object();
     
    7076      ConfigManager manager = ConfigManager.Instance;
    7177      manager.Core = this;
    72 
     78     
     79      //Register all Wcf Service references
    7380      wcfService = WcfService.Instance;
    7481      wcfService.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(wcfService_LoginCompleted);
     
    7885      wcfService.ServerChanged += new EventHandler(wcfService_ServerChanged);
    7986      wcfService.Connected += new EventHandler(wcfService_Connected);
    80       ConnectionContainer cc = ConfigManager.Instance.GetServerIPAndPort();
     87      //Recover Server IP and Port from the Settings Framework
     88      ConnectionContainer cc = ConfigManager.Instance.GetServerIPAndPort();     
    8189      if (cc.IPAdress != String.Empty && cc.Port != 0) {
    8290        wcfService.Connect(cc.IPAdress, cc.Port);
    8391      }
    8492   
     93      //Initialize the heartbeat
    8594      beat = new Heartbeat { Interval = 10000 };
    8695      beat.StartHeartbeat();     
    8796
    8897      MessageQueue queue = MessageQueue.GetInstance();
     98     
     99      //Main processing loop
    89100      while (!ShutdownFlag) {
    90101        MessageContainer container = queue.GetMessage();
     
    95106    }
    96107
     108    /// <summary>
     109    /// Reads and analyzes the Messages from the MessageQueue and starts corresponding actions
     110    /// </summary>
     111    /// <param name="container">The Container, containing the message</param>
    97112    private void DetermineAction(MessageContainer container) {
    98113      switch (container.Message) {
     114        //Server requests to abort a job
    99115        case MessageContainer.MessageType.AbortJob:
    100116          engines[container.JobId].Abort();
    101117          break;
     118        //Job has been successfully aborted
    102119        case MessageContainer.MessageType.JobAborted:
    103120          Debug.WriteLine("-- Job Aborted Message received");
    104121          break;
    105 
     122        //Request a Snapshot from the Execution Engine
    106123        case MessageContainer.MessageType.RequestSnapshot:
    107124          engines[container.JobId].RequestSnapshot();
    108125          break;
     126        //Snapshot is ready and can be sent back to the Server
    109127        case MessageContainer.MessageType.SnapshotReady:
    110128          Thread ssr = new Thread(new ParameterizedThreadStart(GetSnapshot));
    111129          ssr.Start(container.JobId);         
    112130          break;
    113 
     131        //Pull a Job from the Server
    114132        case MessageContainer.MessageType.FetchJob:
    115133          wcfService.PullJobAsync(Guid.NewGuid());
    116134          break;         
     135        //A Job has finished and can be sent back to the server
    117136        case MessageContainer.MessageType.FinishedJob:
    118137          Thread finThread = new Thread(new ParameterizedThreadStart(GetFinishedJob));
    119138          finThread.Start(container.JobId);         
    120139          break;     
     140        //Hard shutdown of the client
    121141        case MessageContainer.MessageType.Shutdown:
    122142          ShutdownFlag = true;
     
    126146    }
    127147
     148    //Asynchronous Threads for interaction with the Execution Engine
    128149    #region Async Threads for the EE
    129150   
     
    146167    #endregion
    147168
     169    //Eventhandlers for the communication with the wcf Layer
    148170    #region wcfService Events
    149171
Note: See TracChangeset for help on using the changeset viewer.