Changeset 841 for trunk/sources
- Timestamp:
- 11/27/08 16:34:46 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Client.Core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager.cs
r770 r841 24 24 using System.Linq; 25 25 using System.Text; 26 using HeuristicLab.Hive.Contracts.BusinessObjects; 26 27 27 28 namespace HeuristicLab.Hive.Client.Core { … … 31 32 public class ConfigurationManager { 32 33 private static ConfigurationManager instance = null; 34 35 private ClientInfo clientInfo; 33 36 private Guid guid; 34 37 … … 47 50 //this won't work this way. We need a plugin for XML Handling. 48 51 guid = Guid.NewGuid(); 52 clientInfo = new ClientInfo(); 53 clientInfo.ClientId = Guid.NewGuid(); 54 clientInfo.NrOfCores = Environment.ProcessorCount; 55 clientInfo.Memory = 1024; 56 clientInfo.Name = Environment.MachineName; 57 } 58 59 public ClientInfo GetClientInfo() { 60 return clientInfo; 61 } 62 63 public void Loggedin() { 64 if (clientInfo == null) { 65 clientInfo = new ClientInfo(); 66 } 67 clientInfo.Login = DateTime.Now; 49 68 } 50 69 -
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r840 r841 68 68 69 69 public void Start() { 70 Heartbeat beat = new Heartbeat { Interval = 5000 };71 beat.StartHeartbeat();72 73 ClientInfo clientInfo = new ClientInfo { ClientId = Guid.NewGuid() };74 75 70 clientCommunicator = ServiceLocator.GetClientCommunicator(); 76 71 clientCommunicator.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(ClientCommunicator_LoginCompleted); 77 72 clientCommunicator.PullJobCompleted += new EventHandler<PullJobCompletedEventArgs>(ClientCommunicator_PullJobCompleted); 78 73 clientCommunicator.SendJobResultCompleted += new EventHandler<SendJobResultCompletedEventArgs>(ClientCommunicator_SendJobResultCompleted); 79 clientCommunicator.LoginAsync(clientInfo); 74 clientCommunicator.LoginAsync(ConfigurationManager.GetInstance().GetClientInfo()); 75 76 Heartbeat beat = new Heartbeat { Interval = 5000 }; 77 beat.StartHeartbeat(); 80 78 81 79 MessageQueue queue = MessageQueue.GetInstance(); … … 91 89 if (e.Result.Success) { 92 90 Logging.GetInstance().Info(this.ToString(), "Login completed to Hive Server @ " + DateTime.Now); 91 ConfigurationManager.GetInstance().Loggedin(); 93 92 Status.LoginTime = DateTime.Now; 94 93 Status.LoggedIn = true; … … 144 143 byte[] sJob = engines[jId].GetFinishedJob(); 145 144 146 JobResult jobResult = new JobResult { JobId = jId, Result = sJob, Client = null};145 JobResult jobResult = new JobResult { JobId = jId, Result = sJob, Client = ConfigurationManager.GetInstance().GetClientInfo() }; 147 146 clientCommunicator.SendJobResultAsync(jobResult, true); 148 147 }
Note: See TracChangeset
for help on using the changeset viewer.