- Timestamp:
- 01/15/09 14:46:57 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Common/NetworkEnum.cs
r932 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.Communication/WcfService.cs
r1103 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; … … 11 32 12 33 namespace HeuristicLab.Hive.Client.Communication { 34 /// <summary> 35 /// WcfService class is implemented as a Singleton and works as a communication Layer with the Server 36 /// </summary> 13 37 public class WcfService { 14 38 private static WcfService instance; 39 /// <summary> 40 /// Getter for the Instance of the WcfService 41 /// </summary> 42 /// <returns>the Instance of the WcfService class</returns> 15 43 public static WcfService Instance { 16 44 get { … … 33 61 public ClientCommunicatorClient proxy = null; 34 62 63 /// <summary> 64 /// Constructor 65 /// </summary> 35 66 private WcfService() { 36 67 ConnState = NetworkEnum.WcfConnState.Disconnected; 37 68 } 69 70 /// <summary> 71 /// Connects with the Server, registers the events and fires the Connected (and quiet possibly the ConnectionRestored) Event. 72 /// </summary> 38 73 public void Connect() { 39 74 try { … … 63 98 } 64 99 100 /// <summary> 101 /// Changes the Connectionsettings (serverIP & serverPort) and reconnects 102 /// </summary> 103 /// <param name="serverIP">current Server IP</param> 104 /// <param name="serverPort">current Server Port</param> 65 105 public void Connect(String serverIP, int serverPort) { 66 106 String oldIp = this.ServerIP; … … 73 113 ServerChanged(this, new EventArgs()); 74 114 } 75 115 116 /// <summary> 117 /// Disconnects the Client from the Server 118 /// </summary> 76 119 public void Disconnect() { 77 120 ConnState = NetworkEnum.WcfConnState.Disconnected; 78 121 } 79 122 123 /// <summary> 124 /// Network communication Error Handler - Every network error gets logged and the connection switches to faulted state 125 /// </summary> 126 /// <param name="e">The Exception</param> 80 127 private void NetworkErrorHandling(Exception e) { 81 128 ConnState = NetworkEnum.WcfConnState.Failed; … … 83 130 } 84 131 132 133 134 /// <summary> 135 /// Methods for the Server Login 136 /// </summary> 85 137 #region Login 86 138 public event System.EventHandler<LoginCompletedEventArgs> LoginCompleted; … … 110 162 #endregion 111 163 164 /// <summary> 165 /// Pull a Job from the Server 166 /// </summary> 112 167 #region PullJob 113 168 public event System.EventHandler<PullJobCompletedEventArgs> PullJobCompleted; … … 124 179 #endregion 125 180 181 /// <summary> 182 /// Send back finished Job Results 183 /// </summary> 126 184 #region SendJobResults 127 185 public event System.EventHandler<SendJobResultCompletedEventArgs> SendJobResultCompleted; … … 147 205 #endregion 148 206 207 /// <summary> 208 /// Methods for sending the periodically Heartbeat 209 /// </summary> 149 210 #region Heartbeat 150 211 -
trunk/sources/HeuristicLab.Hive.Client.Console/Service References/ClientService/Reference.cs
r1087 r1132 322 322 HeuristicLab.Hive.Client.Console.ClientService.StatusCommons EndGetStatusInfos(System.IAsyncResult result); 323 323 324 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClientConsoleCommunicator/GetConnection", ReplyAction="http://tempuri.org/IClientConsoleCommunicator/GetConnectionResponse")]325 HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer GetConnection();326 327 [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/IClientConsoleCommunicator/GetConnection", ReplyAction="http://tempuri.org/IClientConsoleCommunicator/GetConnectionResponse")]328 System.IAsyncResult BeginGetConnection(System.AsyncCallback callback, object asyncState);329 330 HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer EndGetConnection(System.IAsyncResult result);331 332 324 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IClientConsoleCommunicator/SetConnection", ReplyAction="http://tempuri.org/IClientConsoleCommunicator/SetConnectionResponse")] 333 325 void SetConnection(HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer container); … … 388 380 [System.Diagnostics.DebuggerStepThroughAttribute()] 389 381 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")] 390 public partial class GetConnectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {391 392 private object[] results;393 394 public GetConnectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :395 base(exception, cancelled, userState) {396 this.results = results;397 }398 399 public HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer Result {400 get {401 base.RaiseExceptionIfNecessary();402 return ((HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer)(this.results[0]));403 }404 }405 }406 407 [System.Diagnostics.DebuggerStepThroughAttribute()]408 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]409 382 public partial class GetCurrentConnectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { 410 383 … … 434 407 private System.Threading.SendOrPostCallback onGetStatusInfosCompletedDelegate; 435 408 436 private BeginOperationDelegate onBeginGetConnectionDelegate;437 438 private EndOperationDelegate onEndGetConnectionDelegate;439 440 private System.Threading.SendOrPostCallback onGetConnectionCompletedDelegate;441 442 409 private BeginOperationDelegate onBeginSetConnectionDelegate; 443 410 … … 484 451 485 452 public event System.EventHandler<GetStatusInfosCompletedEventArgs> GetStatusInfosCompleted; 486 487 public event System.EventHandler<GetConnectionCompletedEventArgs> GetConnectionCompleted;488 453 489 454 public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> SetConnectionCompleted; … … 543 508 } 544 509 545 public HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer GetConnection() {546 return base.Channel.GetConnection();547 }548 549 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]550 public System.IAsyncResult BeginGetConnection(System.AsyncCallback callback, object asyncState) {551 return base.Channel.BeginGetConnection(callback, asyncState);552 }553 554 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]555 public HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer EndGetConnection(System.IAsyncResult result) {556 return base.Channel.EndGetConnection(result);557 }558 559 private System.IAsyncResult OnBeginGetConnection(object[] inValues, System.AsyncCallback callback, object asyncState) {560 return this.BeginGetConnection(callback, asyncState);561 }562 563 private object[] OnEndGetConnection(System.IAsyncResult result) {564 HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer retVal = this.EndGetConnection(result);565 return new object[] {566 retVal};567 }568 569 private void OnGetConnectionCompleted(object state) {570 if ((this.GetConnectionCompleted != null)) {571 InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));572 this.GetConnectionCompleted(this, new GetConnectionCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));573 }574 }575 576 public void GetConnectionAsync() {577 this.GetConnectionAsync(null);578 }579 580 public void GetConnectionAsync(object userState) {581 if ((this.onBeginGetConnectionDelegate == null)) {582 this.onBeginGetConnectionDelegate = new BeginOperationDelegate(this.OnBeginGetConnection);583 }584 if ((this.onEndGetConnectionDelegate == null)) {585 this.onEndGetConnectionDelegate = new EndOperationDelegate(this.OnEndGetConnection);586 }587 if ((this.onGetConnectionCompletedDelegate == null)) {588 this.onGetConnectionCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetConnectionCompleted);589 }590 base.InvokeAsync(this.onBeginGetConnectionDelegate, null, this.onEndGetConnectionDelegate, this.onGetConnectionCompletedDelegate, userState);591 }592 593 510 public void SetConnection(HeuristicLab.Hive.Client.Console.ClientService.ConnectionContainer container) { 594 511 base.Channel.SetConnection(container); -
trunk/sources/HeuristicLab.Hive.Client.Console/Service References/ClientService/configuration.svcinfo
r954 r1132 6 6 </bindings> 7 7 <endpoints> 8 <endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IClientConsoleCommunicator" contract="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator"><identity><userPrincipalName value="mse0800 4@fhs-hagenberg.ac.at" /></identity></Data>" digest="<?xml version="1.0" encoding="utf-16"?><Data address="net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IClientConsoleCommunicator" contract="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator"><identity><userPrincipalName value="mse08004@fhs-hagenberg.ac.at" /></identity></Data>" contractName="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator" />8 <endpoint normalizedDigest="<?xml version="1.0" encoding="utf-16"?><Data address="net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IClientConsoleCommunicator" contract="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator"><identity><userPrincipalName value="mse08003@fhs-hagenberg.ac.at" /></identity></Data>" digest="<?xml version="1.0" encoding="utf-16"?><Data address="net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IClientConsoleCommunicator" contract="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator"><identity><userPrincipalName value="mse08003@fhs-hagenberg.ac.at" /></identity></Data>" contractName="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator" /> 9 9 </endpoints> 10 10 </configurationSnapshot> -
trunk/sources/HeuristicLab.Hive.Client.Console/Service References/ClientService/configuration91.svcinfo
r954 r1132 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum=" LJHqHAg9UO+arib7mQMPUcNSFqQ=">2 <SavedWcfConfigurationInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="9.1" CheckSum="hpOV9r43IeNDEU5uqNBUck5ld7s="> 3 3 <bindingConfigurations> 4 4 <bindingConfiguration bindingType="netTcpBinding" name="NetTcpBinding_IClientConsoleCommunicator"> … … 137 137 </property> 138 138 <property path="/identity/userPrincipalName/value" isComplexType="false" isExplicitlyDefined="true" clrType="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 139 <serializedValue>mse0800 4@fhs-hagenberg.ac.at</serializedValue>139 <serializedValue>mse08003@fhs-hagenberg.ac.at</serializedValue> 140 140 </property> 141 141 <property path="/identity/servicePrincipalName" isComplexType="true" isExplicitlyDefined="false" clrType="System.ServiceModel.Configuration.ServicePrincipalNameElement, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> -
trunk/sources/HeuristicLab.Hive.Client.Console/Service References/ClientService/service.wsdl
r1087 r1132 48 48 <wsdl:part name="parameters" element="tns:GetStatusInfosResponse" /> 49 49 </wsdl:message> 50 <wsdl:message name="IClientConsoleCommunicator_GetConnection_InputMessage">51 <wsdl:part name="parameters" element="tns:GetConnection" />52 </wsdl:message>53 <wsdl:message name="IClientConsoleCommunicator_GetConnection_OutputMessage">54 <wsdl:part name="parameters" element="tns:GetConnectionResponse" />55 </wsdl:message>56 50 <wsdl:message name="IClientConsoleCommunicator_SetConnection_InputMessage"> 57 51 <wsdl:part name="parameters" element="tns:SetConnection" /> … … 83 77 <wsdl:output wsaw:Action="http://tempuri.org/IClientConsoleCommunicator/GetStatusInfosResponse" message="tns:IClientConsoleCommunicator_GetStatusInfos_OutputMessage" /> 84 78 </wsdl:operation> 85 <wsdl:operation name="GetConnection">86 <wsdl:input wsaw:Action="http://tempuri.org/IClientConsoleCommunicator/GetConnection" message="tns:IClientConsoleCommunicator_GetConnection_InputMessage" />87 <wsdl:output wsaw:Action="http://tempuri.org/IClientConsoleCommunicator/GetConnectionResponse" message="tns:IClientConsoleCommunicator_GetConnection_OutputMessage" />88 </wsdl:operation>89 79 <wsdl:operation name="SetConnection"> 90 80 <wsdl:input wsaw:Action="http://tempuri.org/IClientConsoleCommunicator/SetConnection" message="tns:IClientConsoleCommunicator_SetConnection_InputMessage" /> … … 110 100 <wsdl:operation name="GetStatusInfos"> 111 101 <soap12:operation soapAction="http://tempuri.org/IClientConsoleCommunicator/GetStatusInfos" style="document" /> 112 <wsdl:input>113 <soap12:body use="literal" />114 </wsdl:input>115 <wsdl:output>116 <soap12:body use="literal" />117 </wsdl:output>118 </wsdl:operation>119 <wsdl:operation name="GetConnection">120 <soap12:operation soapAction="http://tempuri.org/IClientConsoleCommunicator/GetConnection" style="document" />121 102 <wsdl:input> 122 103 <soap12:body use="literal" /> … … 169 150 <wsa10:Address>net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator</wsa10:Address> 170 151 <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity"> 171 <Upn>mse0800 4@fhs-hagenberg.ac.at</Upn>152 <Upn>mse08003@fhs-hagenberg.ac.at</Upn> 172 153 </Identity> 173 154 </wsa10:EndpointReference> -
trunk/sources/HeuristicLab.Hive.Client.Console/Service References/ClientService/service.xsd
r1087 r1132 14 14 </xs:complexType> 15 15 </xs:element> 16 <xs:element name="GetConnection">17 <xs:complexType>18 <xs:sequence />19 </xs:complexType>20 </xs:element>21 <xs:element name="GetConnectionResponse">22 <xs:complexType>23 <xs:sequence>24 <xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/HeuristicLab.Hive.Client.Core.ClientConsoleService" minOccurs="0" name="GetConnectionResult" nillable="true" type="q2:ConnectionContainer" />25 </xs:sequence>26 </xs:complexType>27 </xs:element>28 16 <xs:element name="SetConnection"> 29 17 <xs:complexType> 30 18 <xs:sequence> 31 <xs:element xmlns:q 3="http://schemas.datacontract.org/2004/07/HeuristicLab.Hive.Client.Core.ClientConsoleService" minOccurs="0" name="container" nillable="true" type="q3:ConnectionContainer" />19 <xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/HeuristicLab.Hive.Client.Core.ClientConsoleService" minOccurs="0" name="container" nillable="true" type="q2:ConnectionContainer" /> 32 20 </xs:sequence> 33 21 </xs:complexType> … … 56 44 <xs:complexType> 57 45 <xs:sequence> 58 <xs:element xmlns:q 4="http://schemas.datacontract.org/2004/07/HeuristicLab.Hive.Client.Core.ClientConsoleService" minOccurs="0" name="GetCurrentConnectionResult" nillable="true" type="q4:ConnectionContainer" />46 <xs:element xmlns:q3="http://schemas.datacontract.org/2004/07/HeuristicLab.Hive.Client.Core.ClientConsoleService" minOccurs="0" name="GetCurrentConnectionResult" nillable="true" type="q3:ConnectionContainer" /> 59 47 </xs:sequence> 60 48 </xs:complexType> -
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 -
trunk/sources/HeuristicLab.Hive.Client.ExecutionEngine/Executor.cs
r1119 r1132 53 53 public void Start(byte[] serializedJob) { 54 54 CreationTime = DateTime.Now; 55 //Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob);55 Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob); 56 56 //debug 57 Job = new TestJob();57 //Job = new TestJob(); 58 58 Job.JobStopped += new EventHandler(Job_JobStopped); 59 59 Job.Start();
Note: See TracChangeset
for help on using the changeset viewer.