Free cookie consent management tool by TermsFeed Policy Generator

Changeset 790


Ignore:
Timestamp:
11/20/08 15:41:25 (16 years ago)
Author:
whackl
Message:

implemented ticket (#376) (Client Services)

Location:
trunk/sources
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Communication/ServerProxy.cs

    r781 r790  
    33using System.Linq;
    44using System.Text;
    5 using HeuristicLab.Hive.Server.Interfaces;
    65
    76namespace HeuristicLab.Hive.Client.Communication {
     
    1110
    1211    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IClientCommunicator/Login", ReplyAction = "http://tempuri.org/IClientCommunicator/LoginResponse")]
    13     HeuristicLab.Hive.Server.Response Login(HeuristicLab.Hive.Contracts.BusinessObjects.Client clientInfo);
     12    HeuristicLab.Hive.Contracts.Response Login(HeuristicLab.Hive.Contracts.BusinessObjects.Client clientInfo);
    1413
    1514    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://tempuri.org/IClientCommunicator/Login", ReplyAction = "http://tempuri.org/IClientCommunicator/LoginResponse")]
    1615    System.IAsyncResult BeginLogin(HeuristicLab.Hive.Contracts.BusinessObjects.Client clientInfo, System.AsyncCallback callback, object asyncState);
    1716
    18     HeuristicLab.Hive.Server.Response EndLogin(System.IAsyncResult result);
     17    HeuristicLab.Hive.Contracts.Response EndLogin(System.IAsyncResult result);
     18
     19    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IClientCommunicator/SendHeartBeat", ReplyAction = "http://tempuri.org/IClientCommunicator/SendHeartBeatResponse")]
     20    HeuristicLab.Hive.Contracts.ResponseHB SendHeartBeat(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData);
     21
     22    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://tempuri.org/IClientCommunicator/SendHeartBeat", ReplyAction = "http://tempuri.org/IClientCommunicator/SendHeartBeatResponse")]
     23    System.IAsyncResult BeginSendHeartBeat(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData, System.AsyncCallback callback, object asyncState);
     24
     25    HeuristicLab.Hive.Contracts.ResponseHB EndSendHeartBeat(System.IAsyncResult result);
     26
     27    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IClientCommunicator/PullJob", ReplyAction = "http://tempuri.org/IClientCommunicator/PullJobResponse")]
     28    HeuristicLab.Hive.Contracts.ResponseJob PullJob(System.Guid clientId);
     29
     30    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://tempuri.org/IClientCommunicator/PullJob", ReplyAction = "http://tempuri.org/IClientCommunicator/PullJobResponse")]
     31    System.IAsyncResult BeginPullJob(System.Guid clientId, System.AsyncCallback callback, object asyncState);
     32
     33    HeuristicLab.Hive.Contracts.ResponseJob EndPullJob(System.IAsyncResult result);
     34
     35    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IClientCommunicator/SendJobResult", ReplyAction = "http://tempuri.org/IClientCommunicator/SendJobResultResponse")]
     36    HeuristicLab.Hive.Contracts.Response SendJobResult(HeuristicLab.Hive.Contracts.BusinessObjects.JobResult Result, bool finished);
     37
     38    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://tempuri.org/IClientCommunicator/SendJobResult", ReplyAction = "http://tempuri.org/IClientCommunicator/SendJobResultResponse")]
     39    System.IAsyncResult BeginSendJobResult(HeuristicLab.Hive.Contracts.BusinessObjects.JobResult Result, bool finished, System.AsyncCallback callback, object asyncState);
     40
     41    HeuristicLab.Hive.Contracts.Response EndSendJobResult(System.IAsyncResult result);
     42
     43    [System.ServiceModel.OperationContractAttribute(Action = "http://tempuri.org/IClientCommunicator/Logout", ReplyAction = "http://tempuri.org/IClientCommunicator/LogoutResponse")]
     44    HeuristicLab.Hive.Contracts.Response Logout(System.Guid clientId);
     45
     46    [System.ServiceModel.OperationContractAttribute(AsyncPattern = true, Action = "http://tempuri.org/IClientCommunicator/Logout", ReplyAction = "http://tempuri.org/IClientCommunicator/LogoutResponse")]
     47    System.IAsyncResult BeginLogout(System.Guid clientId, System.AsyncCallback callback, object asyncState);
     48
     49    HeuristicLab.Hive.Contracts.Response EndLogout(System.IAsyncResult result);
    1950  }
    2051
     
    3465    }
    3566
    36     public HeuristicLab.Hive.Server.Response Result {
     67    public HeuristicLab.Hive.Contracts.Response Result {
    3768      get {
    3869        base.RaiseExceptionIfNecessary();
    39         return ((HeuristicLab.Hive.Server.Response)(this.results[0]));
     70        return ((HeuristicLab.Hive.Contracts.Response)(this.results[0]));
     71      }
     72    }
     73  }
     74
     75  [System.Diagnostics.DebuggerStepThroughAttribute()]
     76  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
     77  public partial class SendHeartBeatCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
     78
     79    private object[] results;
     80
     81    public SendHeartBeatCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
     82      base(exception, cancelled, userState) {
     83      this.results = results;
     84    }
     85
     86    public HeuristicLab.Hive.Contracts.ResponseHB Result {
     87      get {
     88        base.RaiseExceptionIfNecessary();
     89        return ((HeuristicLab.Hive.Contracts.ResponseHB)(this.results[0]));
     90      }
     91    }
     92  }
     93
     94  [System.Diagnostics.DebuggerStepThroughAttribute()]
     95  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
     96  public partial class PullJobCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
     97
     98    private object[] results;
     99
     100    public PullJobCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
     101      base(exception, cancelled, userState) {
     102      this.results = results;
     103    }
     104
     105    public HeuristicLab.Hive.Contracts.ResponseJob Result {
     106      get {
     107        base.RaiseExceptionIfNecessary();
     108        return ((HeuristicLab.Hive.Contracts.ResponseJob)(this.results[0]));
     109      }
     110    }
     111  }
     112
     113  [System.Diagnostics.DebuggerStepThroughAttribute()]
     114  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
     115  public partial class SendJobResultCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
     116
     117    private object[] results;
     118
     119    public SendJobResultCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
     120      base(exception, cancelled, userState) {
     121      this.results = results;
     122    }
     123
     124    public HeuristicLab.Hive.Contracts.Response Result {
     125      get {
     126        base.RaiseExceptionIfNecessary();
     127        return ((HeuristicLab.Hive.Contracts.Response)(this.results[0]));
     128      }
     129    }
     130  }
     131
     132  [System.Diagnostics.DebuggerStepThroughAttribute()]
     133  [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
     134  public partial class LogoutCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
     135
     136    private object[] results;
     137
     138    public LogoutCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
     139      base(exception, cancelled, userState) {
     140      this.results = results;
     141    }
     142
     143    public HeuristicLab.Hive.Contracts.Response Result {
     144      get {
     145        base.RaiseExceptionIfNecessary();
     146        return ((HeuristicLab.Hive.Contracts.Response)(this.results[0]));
    40147      }
    41148    }
     
    51158
    52159    private System.Threading.SendOrPostCallback onLoginCompletedDelegate;
     160
     161    private BeginOperationDelegate onBeginSendHeartBeatDelegate;
     162
     163    private EndOperationDelegate onEndSendHeartBeatDelegate;
     164
     165    private System.Threading.SendOrPostCallback onSendHeartBeatCompletedDelegate;
     166
     167    private BeginOperationDelegate onBeginPullJobDelegate;
     168
     169    private EndOperationDelegate onEndPullJobDelegate;
     170
     171    private System.Threading.SendOrPostCallback onPullJobCompletedDelegate;
     172
     173    private BeginOperationDelegate onBeginSendJobResultDelegate;
     174
     175    private EndOperationDelegate onEndSendJobResultDelegate;
     176
     177    private System.Threading.SendOrPostCallback onSendJobResultCompletedDelegate;
     178
     179    private BeginOperationDelegate onBeginLogoutDelegate;
     180
     181    private EndOperationDelegate onEndLogoutDelegate;
     182
     183    private System.Threading.SendOrPostCallback onLogoutCompletedDelegate;
    53184
    54185    public ClientCommunicatorClient() {
     
    73204    public event System.EventHandler<LoginCompletedEventArgs> LoginCompleted;
    74205
    75     public HeuristicLab.Hive.Server.Response Login(HeuristicLab.Hive.Contracts.BusinessObjects.Client clientInfo) {
     206    public event System.EventHandler<SendHeartBeatCompletedEventArgs> SendHeartBeatCompleted;
     207
     208    public event System.EventHandler<PullJobCompletedEventArgs> PullJobCompleted;
     209
     210    public event System.EventHandler<SendJobResultCompletedEventArgs> SendJobResultCompleted;
     211
     212    public event System.EventHandler<LogoutCompletedEventArgs> LogoutCompleted;
     213
     214    public HeuristicLab.Hive.Contracts.Response Login(HeuristicLab.Hive.Contracts.BusinessObjects.Client clientInfo) {
    76215      return base.Channel.Login(clientInfo);
    77216    }
     
    83222
    84223    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    85     public HeuristicLab.Hive.Server.Response EndLogin(System.IAsyncResult result) {
     224    public HeuristicLab.Hive.Contracts.Response EndLogin(System.IAsyncResult result) {
    86225      return base.Channel.EndLogin(result);
    87226    }
     
    93232
    94233    private object[] OnEndLogin(System.IAsyncResult result) {
    95       HeuristicLab.Hive.Server.Response retVal = this.EndLogin(result);
     234      HeuristicLab.Hive.Contracts.Response retVal = this.EndLogin(result);
    96235      return new object[] {
    97236                retVal};
     
    122261                    clientInfo}, this.onEndLoginDelegate, this.onLoginCompletedDelegate, userState);
    123262    }
     263
     264    public HeuristicLab.Hive.Contracts.ResponseHB SendHeartBeat(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData) {
     265      return base.Channel.SendHeartBeat(hbData);
     266    }
     267
     268    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     269    public System.IAsyncResult BeginSendHeartBeat(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData, System.AsyncCallback callback, object asyncState) {
     270      return base.Channel.BeginSendHeartBeat(hbData, callback, asyncState);
     271    }
     272
     273    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     274    public HeuristicLab.Hive.Contracts.ResponseHB EndSendHeartBeat(System.IAsyncResult result) {
     275      return base.Channel.EndSendHeartBeat(result);
     276    }
     277
     278    private System.IAsyncResult OnBeginSendHeartBeat(object[] inValues, System.AsyncCallback callback, object asyncState) {
     279      HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData = ((HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData)(inValues[0]));
     280      return this.BeginSendHeartBeat(hbData, callback, asyncState);
     281    }
     282
     283    private object[] OnEndSendHeartBeat(System.IAsyncResult result) {
     284      HeuristicLab.Hive.Contracts.ResponseHB retVal = this.EndSendHeartBeat(result);
     285      return new object[] {
     286                retVal};
     287    }
     288
     289    private void OnSendHeartBeatCompleted(object state) {
     290      if ((this.SendHeartBeatCompleted != null)) {
     291        InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
     292        this.SendHeartBeatCompleted(this, new SendHeartBeatCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
     293      }
     294    }
     295
     296    public void SendHeartBeatAsync(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData) {
     297      this.SendHeartBeatAsync(hbData, null);
     298    }
     299
     300    public void SendHeartBeatAsync(HeuristicLab.Hive.Contracts.BusinessObjects.HeartBeatData hbData, object userState) {
     301      if ((this.onBeginSendHeartBeatDelegate == null)) {
     302        this.onBeginSendHeartBeatDelegate = new BeginOperationDelegate(this.OnBeginSendHeartBeat);
     303      }
     304      if ((this.onEndSendHeartBeatDelegate == null)) {
     305        this.onEndSendHeartBeatDelegate = new EndOperationDelegate(this.OnEndSendHeartBeat);
     306      }
     307      if ((this.onSendHeartBeatCompletedDelegate == null)) {
     308        this.onSendHeartBeatCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSendHeartBeatCompleted);
     309      }
     310      base.InvokeAsync(this.onBeginSendHeartBeatDelegate, new object[] {
     311                    hbData}, this.onEndSendHeartBeatDelegate, this.onSendHeartBeatCompletedDelegate, userState);
     312    }
     313
     314    public HeuristicLab.Hive.Contracts.ResponseJob PullJob(System.Guid clientId) {
     315      return base.Channel.PullJob(clientId);
     316    }
     317
     318    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     319    public System.IAsyncResult BeginPullJob(System.Guid clientId, System.AsyncCallback callback, object asyncState) {
     320      return base.Channel.BeginPullJob(clientId, callback, asyncState);
     321    }
     322
     323    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     324    public HeuristicLab.Hive.Contracts.ResponseJob EndPullJob(System.IAsyncResult result) {
     325      return base.Channel.EndPullJob(result);
     326    }
     327
     328    private System.IAsyncResult OnBeginPullJob(object[] inValues, System.AsyncCallback callback, object asyncState) {
     329      System.Guid clientId = ((System.Guid)(inValues[0]));
     330      return this.BeginPullJob(clientId, callback, asyncState);
     331    }
     332
     333    private object[] OnEndPullJob(System.IAsyncResult result) {
     334      HeuristicLab.Hive.Contracts.ResponseJob retVal = this.EndPullJob(result);
     335      return new object[] {
     336                retVal};
     337    }
     338
     339    private void OnPullJobCompleted(object state) {
     340      if ((this.PullJobCompleted != null)) {
     341        InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
     342        this.PullJobCompleted(this, new PullJobCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
     343      }
     344    }
     345
     346    public void PullJobAsync(System.Guid clientId) {
     347      this.PullJobAsync(clientId, null);
     348    }
     349
     350    public void PullJobAsync(System.Guid clientId, object userState) {
     351      if ((this.onBeginPullJobDelegate == null)) {
     352        this.onBeginPullJobDelegate = new BeginOperationDelegate(this.OnBeginPullJob);
     353      }
     354      if ((this.onEndPullJobDelegate == null)) {
     355        this.onEndPullJobDelegate = new EndOperationDelegate(this.OnEndPullJob);
     356      }
     357      if ((this.onPullJobCompletedDelegate == null)) {
     358        this.onPullJobCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnPullJobCompleted);
     359      }
     360      base.InvokeAsync(this.onBeginPullJobDelegate, new object[] {
     361                    clientId}, this.onEndPullJobDelegate, this.onPullJobCompletedDelegate, userState);
     362    }
     363
     364    public HeuristicLab.Hive.Contracts.Response SendJobResult(HeuristicLab.Hive.Contracts.BusinessObjects.JobResult Result, bool finished) {
     365      return base.Channel.SendJobResult(Result, finished);
     366    }
     367
     368    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     369    public System.IAsyncResult BeginSendJobResult(HeuristicLab.Hive.Contracts.BusinessObjects.JobResult Result, bool finished, System.AsyncCallback callback, object asyncState) {
     370      return base.Channel.BeginSendJobResult(Result, finished, callback, asyncState);
     371    }
     372
     373    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     374    public HeuristicLab.Hive.Contracts.Response EndSendJobResult(System.IAsyncResult result) {
     375      return base.Channel.EndSendJobResult(result);
     376    }
     377
     378    private System.IAsyncResult OnBeginSendJobResult(object[] inValues, System.AsyncCallback callback, object asyncState) {
     379      HeuristicLab.Hive.Contracts.BusinessObjects.JobResult Result = ((HeuristicLab.Hive.Contracts.BusinessObjects.JobResult)(inValues[0]));
     380      bool finished = ((bool)(inValues[1]));
     381      return this.BeginSendJobResult(Result, finished, callback, asyncState);
     382    }
     383
     384    private object[] OnEndSendJobResult(System.IAsyncResult result) {
     385      HeuristicLab.Hive.Contracts.Response retVal = this.EndSendJobResult(result);
     386      return new object[] {
     387                retVal};
     388    }
     389
     390    private void OnSendJobResultCompleted(object state) {
     391      if ((this.SendJobResultCompleted != null)) {
     392        InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
     393        this.SendJobResultCompleted(this, new SendJobResultCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
     394      }
     395    }
     396
     397    public void SendJobResultAsync(HeuristicLab.Hive.Contracts.BusinessObjects.JobResult Result, bool finished) {
     398      this.SendJobResultAsync(Result, finished, null);
     399    }
     400
     401    public void SendJobResultAsync(HeuristicLab.Hive.Contracts.BusinessObjects.JobResult Result, bool finished, object userState) {
     402      if ((this.onBeginSendJobResultDelegate == null)) {
     403        this.onBeginSendJobResultDelegate = new BeginOperationDelegate(this.OnBeginSendJobResult);
     404      }
     405      if ((this.onEndSendJobResultDelegate == null)) {
     406        this.onEndSendJobResultDelegate = new EndOperationDelegate(this.OnEndSendJobResult);
     407      }
     408      if ((this.onSendJobResultCompletedDelegate == null)) {
     409        this.onSendJobResultCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnSendJobResultCompleted);
     410      }
     411      base.InvokeAsync(this.onBeginSendJobResultDelegate, new object[] {
     412                    Result,
     413                    finished}, this.onEndSendJobResultDelegate, this.onSendJobResultCompletedDelegate, userState);
     414    }
     415
     416    public HeuristicLab.Hive.Contracts.Response Logout(System.Guid clientId) {
     417      return base.Channel.Logout(clientId);
     418    }
     419
     420    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     421    public System.IAsyncResult BeginLogout(System.Guid clientId, System.AsyncCallback callback, object asyncState) {
     422      return base.Channel.BeginLogout(clientId, callback, asyncState);
     423    }
     424
     425    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
     426    public HeuristicLab.Hive.Contracts.Response EndLogout(System.IAsyncResult result) {
     427      return base.Channel.EndLogout(result);
     428    }
     429
     430    private System.IAsyncResult OnBeginLogout(object[] inValues, System.AsyncCallback callback, object asyncState) {
     431      System.Guid clientId = ((System.Guid)(inValues[0]));
     432      return this.BeginLogout(clientId, callback, asyncState);
     433    }
     434
     435    private object[] OnEndLogout(System.IAsyncResult result) {
     436      HeuristicLab.Hive.Contracts.Response retVal = this.EndLogout(result);
     437      return new object[] {
     438                retVal};
     439    }
     440
     441    private void OnLogoutCompleted(object state) {
     442      if ((this.LogoutCompleted != null)) {
     443        InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
     444        this.LogoutCompleted(this, new LogoutCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
     445      }
     446    }
     447
     448    public void LogoutAsync(System.Guid clientId) {
     449      this.LogoutAsync(clientId, null);
     450    }
     451
     452    public void LogoutAsync(System.Guid clientId, object userState) {
     453      if ((this.onBeginLogoutDelegate == null)) {
     454        this.onBeginLogoutDelegate = new BeginOperationDelegate(this.OnBeginLogout);
     455      }
     456      if ((this.onEndLogoutDelegate == null)) {
     457        this.onEndLogoutDelegate = new EndOperationDelegate(this.OnEndLogout);
     458      }
     459      if ((this.onLogoutCompletedDelegate == null)) {
     460        this.onLogoutCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnLogoutCompleted);
     461      }
     462      base.InvokeAsync(this.onBeginLogoutDelegate, new object[] {
     463                    clientId}, this.onEndLogoutDelegate, this.onLogoutCompletedDelegate, userState);
     464    }
    124465  }
    125466}
     467
  • trunk/sources/HeuristicLab.Hive.Client.Communication/ServiceLocator.cs

    r781 r790  
    1313        proxy = new ClientCommunicatorClient(
    1414          new NetTcpBinding(),
    15           new EndpointAddress("net.tcp://10.20.53.7:9000/HiveServer/ClientCommunicator")
     15          new EndpointAddress("net.tcp://10.20.53.2:9000/HiveServer/ClientCommunicator")
    1616          );
    1717      }
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r782 r790  
    3232using System.Security.Policy;
    3333using System.Security;
     34using HeuristicLab.Hive.Client.Communication;
     35using BO = HeuristicLab.Hive.Contracts.BusinessObjects;
    3436
    3537
     
    5860    }
    5961
    60     public void Start() {     
    61       Heartbeat beat = new Heartbeat();
    62       beat.Interval = 5000;
    63       beat.StartHeartbeat(); 
     62    public void Start() {
     63      Heartbeat beat = new Heartbeat { Interval = 5000 };
     64      beat.StartHeartbeat();
     65
     66      BO.Client clientInfo = new BO.Client { ClientId = Guid.NewGuid() };
     67
     68      ClientCommunicatorClient clientCommunicator = ServiceLocator.GetClientCommunicator();
     69      clientCommunicator.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(ClientCommunicator_LoginCompleted);
     70      clientCommunicator.LoginAsync(clientInfo);
    6471
    6572      MessageQueue queue = MessageQueue.GetInstance();
    66       queue.AddMessage(MessageContainer.MessageType.FetchJob);     
     73      queue.AddMessage(MessageContainer.MessageType.FetchJob);
    6774      while (true) {
    6875        MessageContainer container = queue.GetMessage();
    6976        Debug.WriteLine("Main loop received this message: " + container.Message.ToString());
    70         Logging.GetInstance().Info(this.ToString(), container.Message.ToString()); 
     77        Logging.GetInstance().Info(this.ToString(), container.Message.ToString());
    7178        DetermineAction(container);
    7279      }
     80    }
     81
     82    void ClientCommunicator_LoginCompleted(object sender, LoginCompletedEventArgs e) {     
     83      if (e.Result.Success) {
     84        Logging.GetInstance().Info(this.ToString(), "Login completed to Hive Server @ " + DateTime.Now);
     85        Status.LoginTime = DateTime.Now;
     86        Status.LoggedIn = true;
     87      } else
     88        Logging.GetInstance().Error(this.ToString(), e.Result.StatusMessage);
    7389    }
    7490
     
    7793      if (sandboxed) {
    7894        pset = new PermissionSet(PermissionState.None);
    79         pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));       
     95        pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
    8096      } else {
    8197        pset = new PermissionSet(PermissionState.Unrestricted);
     
    85101      //Temp Fix!
    86102      setup.PrivateBinPath = "plugins";
    87       return System.AppDomain.CreateDomain("appD", AppDomain.CurrentDomain.Evidence, setup, pset, CreateStrongName(Assembly.GetExecutingAssembly())); 
     103      return System.AppDomain.CreateDomain("appD", AppDomain.CurrentDomain.Evidence, setup, pset, CreateStrongName(Assembly.GetExecutingAssembly()));
    88104
    89105    }
     
    97113          Debug.WriteLine("-- Job Aborted Message received");
    98114          break;
    99        
    100        
     115
     116
    101117        case MessageContainer.MessageType.RequestSnapshot:
    102118          engines[container.JobId].RequestSnapshot();
     
    105121          engines[container.JobId].GetSnapshot();
    106122          break;
    107        
    108        
     123
     124
    109125        case MessageContainer.MessageType.FetchJob:
    110126          bool sandboxed = true;
    111127
    112128          IJob job = CreateNewJob();
    113          
    114           AppDomain appDomain = CreateNewAppDomain(true);
     129
     130          AppDomain appDomain = CreateNewAppDomain(false);
    115131          appDomains.Add(job.JobId, appDomain);
    116          
     132
    117133          Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
    118134          engine.Job = job;
     
    132148      }
    133149    }
    134    
     150
    135151    /// <summary>
    136152    /// Simulator Class for new Jobs. will be replaced with fetching Jobs from the Interface
  • trunk/sources/HeuristicLab.Hive.Client.Core/Heartbeat.cs

    r768 r790  
    2626using System.Timers;
    2727using HeuristicLab.Hive.Client.Common;
     28using HeuristicLab.Hive.Client.Communication;
     29using System.Diagnostics;
     30using HeuristicLab.Hive.Contracts.BusinessObjects;
     31//using BO = HeuristicLab.Hive.Contracts.BusinessObjects;
    2832
    2933namespace HeuristicLab.Hive.Client.Core {
     
    6165    void heartbeatTimer_Elapsed(object sender, ElapsedEventArgs e) {
    6266      Console.WriteLine("tick");
     67      ClientCommunicatorClient clientCommunicator = ServiceLocator.GetClientCommunicator();
     68      HeartBeatData heartBeatData = new HeartBeatData { ClientId = Guid.NewGuid(),
     69                                                              freeCores = 4,
     70                                                              freeMemory = 1000,
     71                                                              jobProgress = 1};
     72
     73      clientCommunicator.SendHeartBeatCompleted += new EventHandler<SendHeartBeatCompletedEventArgs>(ClientCommunicator_SendHeartBeatCompleted);
     74      clientCommunicator.SendHeartBeatAsync(heartBeatData);
     75
    6376      //MessageQueue.GetInstance().AddMessage(MessageContainer.MessageType.FetchJob);
     77
     78    }
     79
     80    void ClientCommunicator_SendHeartBeatCompleted(object sender, SendHeartBeatCompletedEventArgs e) {
     81      System.Diagnostics.Debug.WriteLine("Heartbeat received");
    6482    }
    6583
  • trunk/sources/HeuristicLab.Hive.Client.Core/HeuristicLab.Hive.Client.Core.csproj

    r768 r790  
    8686      <Name>HeuristicLab.Hive.Client.Common</Name>
    8787    </ProjectReference>
     88    <ProjectReference Include="..\HeuristicLab.Hive.Client.Communication\HeuristicLab.Hive.Client.Communication.csproj">
     89      <Project>{AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}</Project>
     90      <Name>HeuristicLab.Hive.Client.Communication</Name>
     91    </ProjectReference>
    8892    <ProjectReference Include="..\HeuristicLab.Hive.Client.ExecutionEngine\HeuristicLab.Hive.Client.ExecutionEngine.csproj">
    8993      <Project>{1605256A-1CB3-44AB-AAFF-577093EE5789}</Project>
    9094      <Name>HeuristicLab.Hive.Client.ExecutionEngine</Name>
     95    </ProjectReference>
     96    <ProjectReference Include="..\HeuristicLab.Hive.Contracts\HeuristicLab.Hive.Contracts.csproj">
     97      <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project>
     98      <Name>HeuristicLab.Hive.Contracts</Name>
    9199    </ProjectReference>
    92100    <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
  • trunk/sources/HeuristicLab.sln

    r778 r790  
    127127EndProject
    128128Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive.Client.ExecutionEngine", "HeuristicLab.Hive.Client.ExecutionEngine\HeuristicLab.Hive.Client.ExecutionEngine.csproj", "{1605256A-1CB3-44AB-AAFF-577093EE5789}"
     129EndProject
     130Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive.Client.Communication", "HeuristicLab.Hive.Client.Communication\HeuristicLab.Hive.Client.Communication.csproj", "{AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}"
    129131EndProject
    130132Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive.Server.Console", "HeuristicLab.Hive.Server.Console\HeuristicLab.Hive.Server.Console.csproj", "{42A1D075-6C12-4DD9-B0C2-C6F5210A8119}"
     
    583585    {1605256A-1CB3-44AB-AAFF-577093EE5789}.Release|Any CPU.Build.0 = Release|Any CPU
    584586    {1605256A-1CB3-44AB-AAFF-577093EE5789}.Release|x86.ActiveCfg = Release|Any CPU
     587<<<<<<< .mine
     588    {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     589    {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}.Debug|Any CPU.Build.0 = Debug|Any CPU
     590    {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}.Debug|x86.ActiveCfg = Debug|Any CPU
     591    {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}.Release|Any CPU.ActiveCfg = Release|Any CPU
     592    {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}.Release|Any CPU.Build.0 = Release|Any CPU
     593    {AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}.Release|x86.ActiveCfg = Release|Any CPU
     594=======
    585595    {42A1D075-6C12-4DD9-B0C2-C6F5210A8119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    586596    {42A1D075-6C12-4DD9-B0C2-C6F5210A8119}.Debug|Any CPU.Build.0 = Debug|Any CPU
     
    589599    {42A1D075-6C12-4DD9-B0C2-C6F5210A8119}.Release|Any CPU.Build.0 = Release|Any CPU
    590600    {42A1D075-6C12-4DD9-B0C2-C6F5210A8119}.Release|x86.ActiveCfg = Release|Any CPU
     601>>>>>>> .r781
    591602  EndGlobalSection
    592603  GlobalSection(SolutionProperties) = preSolution
  • trunk/sources/HeuristicLab/CopyAssemblies.cmd

    r778 r790  
    7070copy %1\HeuristicLab.Hive.Client.Console\%2\HeuristicLab.Hive.Client.Console-3.2.dll .\plugins
    7171copy %1\HeuristicLab.Hive.Client.ExecutionEngine\%2\HeuristicLab.Hive.Client.ExecutionEngine-3.2.dll .\plugins
     72copy %1\HeuristicLab.Hive.Client.Communication\%2\HeuristicLab.Hive.Client.Communication-3.2.dll .\plugins
     73copy %1\HeuristicLab.Hive.Client.ExecutionEngine\%2\HeuristicLab.Hive.Client.ExecutionEngine-3.2.dll .\plugins
    7274copy %1\HeuristicLab.Hive.Server.Console\%2\HeuristicLab.Hive.Server.Console-3.2.dll .\plugins
Note: See TracChangeset for help on using the changeset viewer.