Free cookie consent management tool by TermsFeed Policy Generator

Changeset 841 for trunk/sources


Ignore:
Timestamp:
11/27/08 16:34:46 (16 years ago)
Author:
kgrading
Message:

implemented (#400)

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

Legend:

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

    r770 r841  
    2424using System.Linq;
    2525using System.Text;
     26using HeuristicLab.Hive.Contracts.BusinessObjects;
    2627
    2728namespace HeuristicLab.Hive.Client.Core {
     
    3132  public class ConfigurationManager {
    3233    private static ConfigurationManager instance = null;
     34
     35    private ClientInfo clientInfo;
    3336    private Guid guid;
    3437
     
    4750      //this won't work this way. We need a plugin for XML Handling.
    4851      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;
    4968    }
    5069
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r840 r841  
    6868
    6969    public void Start() {
    70       Heartbeat beat = new Heartbeat { Interval = 5000 };
    71       beat.StartHeartbeat();
    72 
    73       ClientInfo clientInfo = new ClientInfo { ClientId = Guid.NewGuid() };
    74 
    7570      clientCommunicator = ServiceLocator.GetClientCommunicator();
    7671      clientCommunicator.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(ClientCommunicator_LoginCompleted);
    7772      clientCommunicator.PullJobCompleted += new EventHandler<PullJobCompletedEventArgs>(ClientCommunicator_PullJobCompleted);
    7873      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();     
    8078
    8179      MessageQueue queue = MessageQueue.GetInstance();
     
    9189      if (e.Result.Success) {
    9290        Logging.GetInstance().Info(this.ToString(), "Login completed to Hive Server @ " + DateTime.Now);
     91        ConfigurationManager.GetInstance().Loggedin();
    9392        Status.LoginTime = DateTime.Now;
    9493        Status.LoggedIn = true;
     
    144143      byte[] sJob = engines[jId].GetFinishedJob();
    145144     
    146       JobResult jobResult = new JobResult { JobId = jId, Result = sJob, Client = null };
     145      JobResult jobResult = new JobResult { JobId = jId, Result = sJob, Client = ConfigurationManager.GetInstance().GetClientInfo() };
    147146      clientCommunicator.SendJobResultAsync(jobResult, true);
    148147    }
Note: See TracChangeset for help on using the changeset viewer.