Changeset 1132 for trunk/sources/HeuristicLab.Hive.Client.Core
- Timestamp:
- 01/15/09 14:46:57 (15 years ago)
- 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 17 17 return ConfigManager.Instance.GetStatusForClientConsole(); 18 18 } 19 }20 21 public ConnectionContainer GetConnection() {22 return new ConnectionContainer{IPAdress = WcfService.Instance.ServerIP, Port = WcfService.Instance.ServerPort } ;23 19 } 24 20 -
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 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 6 27 7 28 namespace HeuristicLab.Hive.Client.Core.ClientConsoleService.Interfaces { 29 /// <summary> 30 /// Defines the interfaces for the Client Console 31 /// </summary> 8 32 [ServiceContract] 9 33 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> 10 38 [OperationContract] 11 39 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> 14 44 [OperationContract] 15 45 void SetConnection(ConnectionContainer container); 46 /// <summary> 47 /// Signals the client to disconnect from the server 48 /// </summary> 16 49 [OperationContract] 17 50 void Disconnect(); 51 /// <summary> 52 /// Get the current connection details 53 /// </summary> 54 /// <returns>the ConnectionContainer Object</returns> 18 55 [OperationContract] 19 56 ConnectionContainer GetCurrentConnection(); 57 /// <summary> 58 /// Signals the client to exit all jobs and shutdown 59 /// </summary> 20 60 [OperationContract] 21 61 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 22 using System; 2 23 using System.Collections.Generic; 3 24 using 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 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 8 29 [DataContract] 9 30 public class JobStatus { 31 /// <summary> 32 /// Id of the Job 33 /// </summary> 10 34 [DataMember] 11 35 public long JobId { get; set; } 36 /// <summary> 37 /// When has the calculation of the Job begun? 38 /// </summary> 12 39 [DataMember] 13 40 public DateTime Since { get; set; } 41 /// <summary> 42 /// Current progress 43 /// </summary> 14 44 [DataMember] 15 45 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 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; … … 7 28 8 29 namespace HeuristicLab.Hive.Client.Core.ClientConsoleService { 30 /// <summary> 31 /// Various Status Information for the ClientConsole 32 /// </summary> 9 33 [DataContract] 10 34 public class StatusCommons { -
trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager/ConfigManager.cs
r1119 r1132 51 51 /// Constructor for the singleton, must recover Guid, Calendar, ... 52 52 /// </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() { 56 54 hardwareInfo = new ClientInfo(); 57 55 … … 68 66 } 69 67 68 /// <summary> 69 /// Get all the Information about the client 70 /// </summary> 71 /// <returns>the ClientInfo object</returns> 70 72 public ClientInfo GetClientInfo() { 71 73 hardwareInfo.Login = WcfService.Instance.ConnectedSince; … … 73 75 } 74 76 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> 75 81 public ConnectionContainer GetServerIPAndPort() { 76 82 ConnectionContainer cc = new ConnectionContainer(); … … 80 86 } 81 87 88 /// <summary> 89 /// Sets and saves IP and Port in the Settings framework 90 /// </summary> 91 /// <param name="cc"></param> 82 92 public void SetServerIPAndPort(ConnectionContainer cc) { 83 93 Settings.Default.ServerIP = cc.IPAdress; … … 85 95 Settings.Default.Save(); 86 96 } 87 97 /// <summary> 98 /// collects and returns information that get displayed by the Client Console 99 /// </summary> 100 /// <returns></returns> 88 101 public StatusCommons GetStatusForClientConsole() { 89 102 StatusCommons st = new StatusCommons(); -
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r1120 r1132 46 46 47 47 namespace HeuristicLab.Hive.Client.Core { 48 /// <summary> 49 /// The core component of the Hive Client 50 /// </summary> 48 51 public class Core: MarshalByRefObject { 49 52 public delegate string GetASnapshotDelegate(); … … 59 62 private WcfService wcfService; 60 63 private Heartbeat beat; 61 64 65 /// <summary> 66 /// Main Method for the client 67 /// </summary> 62 68 public void Start() { 63 69 Core.Locker = new Object(); … … 70 76 ConfigManager manager = ConfigManager.Instance; 71 77 manager.Core = this; 72 78 79 //Register all Wcf Service references 73 80 wcfService = WcfService.Instance; 74 81 wcfService.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(wcfService_LoginCompleted); … … 78 85 wcfService.ServerChanged += new EventHandler(wcfService_ServerChanged); 79 86 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(); 81 89 if (cc.IPAdress != String.Empty && cc.Port != 0) { 82 90 wcfService.Connect(cc.IPAdress, cc.Port); 83 91 } 84 92 93 //Initialize the heartbeat 85 94 beat = new Heartbeat { Interval = 10000 }; 86 95 beat.StartHeartbeat(); 87 96 88 97 MessageQueue queue = MessageQueue.GetInstance(); 98 99 //Main processing loop 89 100 while (!ShutdownFlag) { 90 101 MessageContainer container = queue.GetMessage(); … … 95 106 } 96 107 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> 97 112 private void DetermineAction(MessageContainer container) { 98 113 switch (container.Message) { 114 //Server requests to abort a job 99 115 case MessageContainer.MessageType.AbortJob: 100 116 engines[container.JobId].Abort(); 101 117 break; 118 //Job has been successfully aborted 102 119 case MessageContainer.MessageType.JobAborted: 103 120 Debug.WriteLine("-- Job Aborted Message received"); 104 121 break; 105 122 //Request a Snapshot from the Execution Engine 106 123 case MessageContainer.MessageType.RequestSnapshot: 107 124 engines[container.JobId].RequestSnapshot(); 108 125 break; 126 //Snapshot is ready and can be sent back to the Server 109 127 case MessageContainer.MessageType.SnapshotReady: 110 128 Thread ssr = new Thread(new ParameterizedThreadStart(GetSnapshot)); 111 129 ssr.Start(container.JobId); 112 130 break; 113 131 //Pull a Job from the Server 114 132 case MessageContainer.MessageType.FetchJob: 115 133 wcfService.PullJobAsync(Guid.NewGuid()); 116 134 break; 135 //A Job has finished and can be sent back to the server 117 136 case MessageContainer.MessageType.FinishedJob: 118 137 Thread finThread = new Thread(new ParameterizedThreadStart(GetFinishedJob)); 119 138 finThread.Start(container.JobId); 120 139 break; 140 //Hard shutdown of the client 121 141 case MessageContainer.MessageType.Shutdown: 122 142 ShutdownFlag = true; … … 126 146 } 127 147 148 //Asynchronous Threads for interaction with the Execution Engine 128 149 #region Async Threads for the EE 129 150 … … 146 167 #endregion 147 168 169 //Eventhandlers for the communication with the wcf Layer 148 170 #region wcfService Events 149 171
Note: See TracChangeset
for help on using the changeset viewer.