Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/21/10 18:46:12 (14 years ago)
Author:
ascheibe
Message:

#1233

  • Implemented communication interface between Slave and a Slave Client using Named Pipes and callbacks
  • Added new project for testing Slave - Client communication
  • Added some copyright info headers
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
13 added
20 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs

    r5155 r5156  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using System;
    223using System.Collections.Generic;
    324using System.IO;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockJob.cs

    r5137 r5156  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using System;
    223using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     24using System.Diagnostics;
     25using System.Threading;
     26using HeuristicLab.Common;
     27using HeuristicLab.Core;
    528using HeuristicLab.Hive;
    629using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    7 using HeuristicLab.Core;
    8 using HeuristicLab.Common;
    9 using System.Drawing;
    10 using System.Threading;
    11 using System.Diagnostics;
    1230
    1331namespace HeuristicLab.Clients.Hive.Slave.Tests {
     
    172190      if (handler != null) handler(this, EventArgs.Empty);
    173191    }
    174                                                      
     192
    175193    public event EventHandler JobFailed;
    176194    protected virtual void OnJobFailed(Exception e) {
    177195      EventHandler handler = JobFailed;
    178       EventArgs<Exception> ev = new EventArgs<Exception>(e);         
     196      EventArgs<Exception> ev = new EventArgs<Exception>(e);
    179197      if (handler != null) handler(this, ev);
    180198    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockServiceLocator.cs

    r5104 r5156  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
    522using HeuristicLab.Clients.Common;
    623using HeuristicLab.Services.Hive.Common.ServiceContracts;
    724
    825namespace HeuristicLab.Clients.Hive.Slave.Tests {
    9   internal class MockServiceLocator : IServiceLocator {
     26  public class MockServiceLocator : IServiceLocator {
    1027
    1128    private MockHiveService service;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/PluginLoader.cs

    r5055 r5156  
    1 
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
    222using System;
    323using System.Collections.Generic;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveTest.cs

    r5137 r5156  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs

    r5137 r5156  
    2626using System.Threading;
    2727using HeuristicLab.Clients.Hive.Slave;
     28using HeuristicLab.Clients.Hive.Slave.ServiceContracts;
    2829using HeuristicLab.Common;
    2930using HeuristicLab.Core;
     
    4546
    4647    private WcfService wcfService;
    47     public HeartbeatManager heartbeatManager;
    48 
     48    private HeartbeatManager heartbeatManager;
    4949    private int coreThreadId;
     50
     51    private ISlaveCommunication ClientCom;
    5052
    5153    public Dictionary<Guid, Executor> ExecutionEngines {
     
    6668    public void Start() {
    6769      abortRequested = false;
    68       Logger.Info("Hive Slave started");
    69       //TODO: implement slave console server
    70       //SlaveConsoleServer server = new SlaveConsoleServer();
    71       //server.Start();
     70
     71      ClientCom = SlaveClientCom.Instance.ClientCom;
     72      ClientCom.LogMessage("Hive Slave started");
    7273
    7374      ConfigManager manager = ConfigManager.Instance;
     
    8283      DeRegisterServiceEvents();
    8384
    84       //server.Close();
    85       Logger.Info("Program shutdown");
     85      ClientCom.LogMessage("Program shutdown");
    8686    }
    8787
     
    101101
    102102    private void RegisterServiceEvents() {
    103       //TODO
     103      WcfService.Instance.Connected += new EventHandler(wcfService_Connected);
     104      WcfService.Instance.ExceptionOccured += new EventHandler<EventArgs<Exception>>(wcfService_ExceptionOccured);
    104105    }
    105106
    106107    private void DeRegisterServiceEvents() {
    107       //TODO
     108      WcfService.Instance.Connected -= wcfService_Connected;
     109      WcfService.Instance.ExceptionOccured -= wcfService_ExceptionOccured;
     110    }
     111
     112    void wcfService_ExceptionOccured(object sender, EventArgs<Exception> e) {
     113      ClientCom.LogMessage("Connection to server interruped with exception: " + e.Value.Message);
     114      ShutdownCore();
     115    }
     116
     117    void wcfService_Connected(object sender, EventArgs e) {
     118      ClientCom.LogMessage("Connected successfully to Hive server");
    108119    }
    109120
     
    113124    /// <param name="container">The Container, containing the message</param>
    114125    private void DetermineAction(MessageContainer container) {
    115       Logger.Info("Message: " + container.Message.ToString() + " for job: " + container.JobId);
     126      ClientCom.LogMessage("Message: " + container.Message.ToString() + " for job: " + container.JobId);
    116127      //TODO: find a better solution
    117128      if (container is ExecutorMessageContainer<Guid>) {
     
    129140                // appdomain already unloaded. Finishing job probably ongoing
    130141              } else
    131               Logger.Error("AbortJob: Engine doesn't exist");
     142              ClientCom.LogMessage("AbortJob: Engine doesn't exist");
    132143            break;
    133144
     
    146157        }
    147158      } else {
    148         Logger.Warn("Unknown MessageContainer: " + container);
     159        ClientCom.LogMessage("Unknown MessageContainer: " + container);
    149160      }
    150161    }
    151162
    152163    public void ShutdownCore() {
    153       Logger.Info("Shutdown Signal received");
    154       Logger.Debug("Stopping heartbeat");
     164      ClientCom.LogMessage("Shutdown Signal received");
     165      ClientCom.LogMessage("Stopping heartbeat");
    155166      heartbeatManager.StopHeartBeat();
    156167      abortRequested = true;
    157       Logger.Debug("Logging out");
     168      ClientCom.LogMessage("Logging out");
    158169
    159170      lock (engines) {
    160         Logger.Debug("engines locked");
     171        ClientCom.LogMessage("engines locked");
    161172        foreach (KeyValuePair<Guid, AppDomain> kvp in appDomains) {
    162           Logger.Debug("Shutting down Appdomain for " + kvp.Key);
     173          ClientCom.LogMessage("Shutting down Appdomain for " + kvp.Key);
    163174          appDomains[kvp.Key].UnhandledException -= new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    164175          AppDomain.Unload(kvp.Value);
     
    166177      }
    167178      WcfService.Instance.Disconnect();
     179      ClientCom.Shutdown();
     180      SlaveClientCom.Close();
    168181    }
    169182
     
    176189    public void PauseJob(JobData data) {
    177190      if (!Jobs.ContainsKey(data.JobId)) {
    178         Logger.Error("Can't find job with id " + data.JobId);
     191        ClientCom.LogMessage("Can't find job with id " + data.JobId);
    179192      } else {
    180193        Job job = Jobs[data.JobId];
     
    194207      try {
    195208        Guid jId = (Guid)jobId;
    196         Logger.Info("Getting the finished job with id: " + jId);
     209        ClientCom.LogMessage("Getting the finished job with id: " + jId);
    197210        if (!engines.ContainsKey(jId)) {
    198           Logger.Info("Engine doesn't exist");
     211          ClientCom.LogMessage("Engine doesn't exist");
    199212          return;
    200213        }
    201214        if (!jobs.ContainsKey(jId)) {
    202           Logger.Info("Job doesn't exist");
     215          ClientCom.LogMessage("Job doesn't exist");
    203216          return;
    204217        }
     
    210223
    211224        try {
    212           Logger.Info("Sending the finished job with id: " + jId);
     225          ClientCom.LogMessage("Sending the finished job with id: " + jId);
    213226          wcfService.UpdateJob(cJob, sJob);
    214227          SlaveStatusInfo.JobsProcessed++;
    215228        }
    216229        catch (Exception e) {
    217           Logger.Info("Transmitting to server failed. Storing the finished job with id: " + jId + " to hdd (" + e.ToString() + ")");
     230          ClientCom.LogMessage("Transmitting to server failed. Storing the finished job with id: " + jId + " to hdd (" + e.ToString() + ")");
    218231        }
    219232        finally {
     
    233246    /// <param name="e"></param>
    234247    private void StartJobInAppDomain(Job myJob, JobData jobData) {
    235       Logger.Info("Received new job with id " + myJob.Id);
     248      ClientCom.LogMessage("Received new job with id " + myJob.Id);
    236249      String pluginDir = Path.Combine(PluginCache.Instance.PluginTempBaseDir, myJob.Id.ToString());
    237250      bool pluginsPrepared = false;
     
    239252      try {
    240253        PluginCache.Instance.PreparePlugins(myJob, jobData);
    241         Logger.Debug("Plugins fetched for job " + myJob.Id);
     254        ClientCom.LogMessage("Plugins fetched for job " + myJob.Id);
    242255        pluginsPrepared = true;
    243256      }
    244257      catch (Exception exception) {
    245         Logger.Error(string.Format("Copying plugins for job {0} failed: {1}", myJob.Id, exception));
     258        ClientCom.LogMessage(string.Format("Copying plugins for job {0} failed: {1}", myJob.Id, exception));
    246259      }
    247260
     
    254267              jobs.Add(myJob.Id, myJob);
    255268              appDomains.Add(myJob.Id, appDomain);
    256               Logger.Debug("Creating AppDomain");
     269              ClientCom.LogMessage("Creating AppDomain");
    257270              Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
    258               Logger.Debug("Created AppDomain");
     271              ClientCom.LogMessage("Created AppDomain");
    259272              engine.JobId = myJob.Id;
    260273              engine.core = this;
    261               Logger.Debug("Starting Engine for job " + myJob.Id);
     274              ClientCom.LogMessage("Starting Engine for job " + myJob.Id);
    262275              engines.Add(myJob.Id, engine);
    263276              engine.Start(jobData.Data);
    264277              SlaveStatusInfo.JobsFetched++;
    265               Logger.Info("Increment FetchedJobs to:" + SlaveStatusInfo.JobsFetched);
     278              ClientCom.LogMessage("Increment FetchedJobs to:" + SlaveStatusInfo.JobsFetched);
    266279            }
    267280          }
     
    269282        }
    270283        catch (Exception exception) {
    271           Logger.Error("Creating the Appdomain and loading the job failed for job " + myJob.Id);
    272           Logger.Error("Error thrown is: ", exception);
     284          ClientCom.LogMessage("Creating the Appdomain and loading the job failed for job " + myJob.Id);
     285          ClientCom.LogMessage("Error thrown is: " + exception.ToString());
    273286          KillAppDomain(myJob.Id);
    274287        }
     
    278291    public event EventHandler<EventArgs<Exception>> ExceptionOccured;
    279292    private void OnExceptionOccured(Exception e) {
    280       Logger.Error("Error: " + e.ToString());
     293      ClientCom.LogMessage("Error: " + e.ToString());
    281294      var handler = ExceptionOccured;
    282295      if (handler != null) handler(this, new EventArgs<Exception>(e));
     
    284297
    285298    private void appDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) {
    286       Logger.Error("Exception in AppDomain: " + e.ExceptionObject.ToString());
     299      ClientCom.LogMessage("Exception in AppDomain: " + e.ExceptionObject.ToString());
    287300      KillAppDomain(new Guid(e.ExceptionObject.ToString()));
    288301    }
     
    316329    public void KillAppDomain(Guid id) {
    317330      if (EnqueueExecutorMessage<Guid>(KillAppDomain, id)) {
    318         Logger.Debug("Shutting down Appdomain for Job " + id);
     331        ClientCom.LogMessage("Shutting down Appdomain for Job " + id);
    319332        lock (engines) {
    320333          try {
     
    334347                }
    335348                catch (CannotUnloadAppDomainException) {
    336                   Logger.Error("Could not unload AppDomain, will try again in 1 sec.");
     349                  ClientCom.LogMessage("Could not unload AppDomain, will try again in 1 sec.");
    337350                  Thread.Sleep(1000);
    338351                  repeat--;
     
    350363          }
    351364          catch (Exception ex) {
    352             Logger.Error("Exception when unloading the appdomain: ", ex);
     365            ClientCom.LogMessage("Exception when unloading the appdomain: " + ex.ToString());
    353366          }
    354367        }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeartbeatManager.cs

    r5137 r5156  
    9797              };
    9898
    99               Logger.Debug("Sending Heartbeat: " + heartBeatData);
     99              SlaveClientCom.Instance.ClientCom.LogMessage("Sending Heartbeat: " + heartBeatData);
    100100              List<MessageContainer> msgs = wcfService.SendHeartbeat(heartBeatData);
    101101
    102102              if (msgs == null) {
    103                 Logger.Debug("Error getting response from Heartbeat");
     103                SlaveClientCom.Instance.ClientCom.LogMessage("Error getting response from Heartbeat");
    104104                OnExceptionOccured(new Exception("Error getting response from Heartbeat"));
    105105              }
    106106
    107               Logger.Debug("Heartbeat Response received: ");
    108               msgs.ForEach(mc => Logger.Debug(mc.Message.ToString()));
     107              SlaveClientCom.Instance.ClientCom.LogMessage("Heartbeat Response received: ");
     108              msgs.ForEach(mc => SlaveClientCom.Instance.ClientCom.LogMessage(mc.Message.ToString()));
    109109              msgs.ForEach(mc => MessageQueue.GetInstance().AddMessage(mc));
    110110            }
     
    112112        }
    113113        catch (Exception e) {
    114           Logger.Error("Heartbeat Thread failed badly: " + e.Message);
     114          SlaveClientCom.Instance.ClientCom.LogMessage("Heartbeat Thread failed badly: " + e.Message);
    115115          OnExceptionOccured(e);
    116116        }
     
    118118      }
    119119      waitHandle.Close();
    120       Logger.Debug("Heartbeat thread stopped");
     120      SlaveClientCom.Instance.ClientCom.LogMessage("Heartbeat thread stopped");
    121121    }
    122122
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeuristicLab.Clients.Hive.Slave-3.4.csproj

    r5137 r5156  
    6464  <ItemGroup>
    6565    <Compile Include="ConfigManager.cs" />
     66    <Compile Include="SlaveClientCom.cs" />
    6667    <Compile Include="Core.cs" />
     68    <Compile Include="DummyListener.cs" />
    6769    <Compile Include="Executor.cs" />
    6870    <Compile Include="HeartbeatManager.cs" />
     
    8284      <DependentUpon>Settings.settings</DependentUpon>
    8385    </Compile>
     86    <Compile Include="ServiceContracts\ISlaveCommunication.cs" />
     87    <Compile Include="ServiceContracts\ISlaveCommunicationCallbacks.cs" />
     88    <Compile Include="SlaveCommunicationService.cs" />
    8489    <Compile Include="SlaveStatusInfo.cs" />
    8590    <Compile Include="StatusCommons.cs" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/PluginCache.cs

    r5105 r5156  
    2424using System.IO;
    2525using System.Linq;
     26using System.Reflection;
    2627using System.Runtime.CompilerServices;
    27 using HeuristicLab.Services.Hive.Common.ServiceContracts;
    28 using HeuristicLab.Services.Hive.Common.DataTransfer;
     28using System.Threading;
     29using HeuristicLab.Clients.Hive.Salve;
    2930using HeuristicLab.PluginInfrastructure;
    3031using HeuristicLab.PluginInfrastructure.Manager;
    31 using System.Threading;
    32 using System.Reflection;
    33 using HeuristicLab.Clients.Hive.Salve;
     32using HeuristicLab.Services.Hive.Common.DataTransfer;
    3433
    3534namespace HeuristicLab.Clients.Hive.Slave {
     
    127126    internal void PreparePlugins(Job myJob, JobData jobData) {
    128127      lock (locker) {
    129         Logger.Debug("Fetching plugins for job");
     128        SlaveClientCom.Instance.ClientCom.LogMessage("Fetching plugins for job");
    130129
    131130        IEnumerable<Plugin> pluginDescriptions = WcfService.Instance.GetPlugins();
     
    153152          }
    154153          if (!found) {
    155             Logger.Debug("Plugin NOT found " + info.Name + ", " + info.Version);
     154            SlaveClientCom.Instance.ClientCom.LogMessage("Plugin NOT found " + info.Name + ", " + info.Version);
    156155            missingPlugins.Add(info);
    157156            missingGuids.Add(info.Id);
     
    160159        }
    161160
    162         Logger.Debug("First run - Update the plugins in the cache");
     161        SlaveClientCom.Instance.ClientCom.LogMessage("First run - Update the plugins in the cache");
    163162        localPlugins.AddRange(missingPlugins);
    164163
     
    176175            if (pd != null) {
    177176              foreach (IPluginFile ipf in pd.Files) {
    178                 Logger.Debug(string.Format("deleting {0}", Path.GetFileName(ipf.Name)));
     177                SlaveClientCom.Instance.ClientCom.LogMessage(string.Format("deleting {0}", Path.GetFileName(ipf.Name)));
    179178                File.Delete(ipf.Name);
    180179              }
     
    195194    internal void DeletePluginsForJob(Guid id) {
    196195      try {
    197         Logger.Debug("unloading...");
     196        SlaveClientCom.Instance.ClientCom.LogMessage("unloading...");
    198197        int tries = 5;
    199198        while (tries > 0) {
     
    210209      }
    211210      catch (Exception ex) {
    212         Logger.Debug("failed while unloading " + id + " with exception " + ex);
     211        SlaveClientCom.Instance.ClientCom.LogMessage("failed while unloading " + id + " with exception " + ex);
    213212      }
    214213    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs

    r5105 r5156  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Clients.Common;
     25using HeuristicLab.Clients.Hive.Slave.Properties;
    2426using HeuristicLab.Common;
    25 using HeuristicLab.Clients.Common;
     27using HeuristicLab.Services.Hive.Common;
     28using HeuristicLab.Services.Hive.Common.DataTransfer;
    2629using HeuristicLab.Services.Hive.Common.ServiceContracts;
    27 using HeuristicLab.Services.Hive.Common.DataTransfer;
    28 using HeuristicLab.Services.Hive.Common;
    29 using HeuristicLab.Clients.Hive.Slave.Properties;
    3030
    3131namespace HeuristicLab.Clients.Hive.Salve {
     
    4343      get {
    4444        if (instance == null) {
    45           Logger.Debug("New WcfService Instance created");
    4645          instance = new WcfService();
    4746        }
     
    5453
    5554    public event EventHandler Connected;
    56     public void OnConnected() {
     55    private void OnConnected() {
    5756      var handler = Connected;
    5857      if (handler != null) handler(this, EventArgs.Empty);
    5958    }
    6059
     60    public event EventHandler<EventArgs<Exception>> ExceptionOccured;
     61    private void OnExceptionOccured(Exception e) {
     62      var handler = ExceptionOccured;
     63      if (handler != null) handler(this, new EventArgs<Exception>(e));
     64    }
     65
    6166    /// <summary>
    6267    /// Constructor
     
    7277      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
    7378        try {
    74           Logger.Debug("Starting the Connection Process");
    7579          ConnState = NetworkEnum.WcfConnState.Connected;
    7680          ConnectedSince = DateTime.Now;
     
    105109    private void HandleNetworkError(Exception e) {
    106110      ConnState = NetworkEnum.WcfConnState.Failed;
    107       Logger.Error("Network exception occurred: " + e);
    108111      OnExceptionOccured(e);
    109112    }
     
    247250      }
    248251    }
    249 
    250     public event EventHandler<EventArgs<Exception>> ExceptionOccured;
    251     private void OnExceptionOccured(Exception e) {
    252       Logger.Error("Error: " + e.ToString());
    253       var handler = ExceptionOccured;
    254       if (handler != null) handler(this, new EventArgs<Exception>(e));
    255     }
    256252  }
    257253}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app.config

    r5105 r5156  
    1313        </HeuristicLab.Clients.Hive.Slave.Properties.Settings>
    1414    </userSettings>
     15
     16  <system.serviceModel>
     17    <services>
     18      <service name="HeuristicLab.Clients.Hive.Slave.SlaveCommunicationService">       
     19        <endpoint address="net.pipe://localhost/HeuristicLabSlaveCom"
     20                  binding="netNamedPipeBinding"
     21                  contract="HeuristicLab.Clients.Hive.Slave.ServiceContracts.ISlaveCommunication"                 
     22                   />
     23      </service>
     24    </services>
     25  </system.serviceModel>
     26
    1527</configuration>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/IServiceLocator.cs

    r5055 r5156  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using HeuristicLab.Clients.Common;
    523using HeuristicLab.Services.Hive.Common.ServiceContracts;
    6 using HeuristicLab.Services.Hive.Common;
    7 using HeuristicLab.Clients.Common;
    824
    925namespace HeuristicLab.Clients.Hive {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/PersistenceUtil.cs

    r4629 r5156  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
    522using System.IO;
    623using HeuristicLab.Persistence.Default.Xml;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Hive 3.4.sln

    r5078 r5156  
    5555EndProject
    5656Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Hive.Tests-3.4", "HeuristicLab.Services.Hive.Tests\HeuristicLab.Services.Hive.Tests-3.4.csproj", "{17187EAC-5D8C-4B11-9CEA-D88F71B59658}"
     57EndProject
     58Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4", "HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4\HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4.csproj", "{464D70B8-2D91-485C-B622-22E4A4891C68}"
    5759EndProject
    5860Global
     
    179181    {17187EAC-5D8C-4B11-9CEA-D88F71B59658}.Release|Mixed Platforms.Build.0 = Release|Any CPU
    180182    {17187EAC-5D8C-4B11-9CEA-D88F71B59658}.Release|x86.ActiveCfg = Release|Any CPU
     183    {464D70B8-2D91-485C-B622-22E4A4891C68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     184    {464D70B8-2D91-485C-B622-22E4A4891C68}.Debug|Any CPU.Build.0 = Debug|Any CPU
     185    {464D70B8-2D91-485C-B622-22E4A4891C68}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     186    {464D70B8-2D91-485C-B622-22E4A4891C68}.Debug|Mixed Platforms.Build.0 = Debug|x86
     187    {464D70B8-2D91-485C-B622-22E4A4891C68}.Debug|x86.ActiveCfg = Debug|x86
     188    {464D70B8-2D91-485C-B622-22E4A4891C68}.Debug|x86.Build.0 = Debug|x86
     189    {464D70B8-2D91-485C-B622-22E4A4891C68}.Release|Any CPU.ActiveCfg = Release|x86
     190    {464D70B8-2D91-485C-B622-22E4A4891C68}.Release|Mixed Platforms.ActiveCfg = Release|x86
     191    {464D70B8-2D91-485C-B622-22E4A4891C68}.Release|Mixed Platforms.Build.0 = Release|x86
     192    {464D70B8-2D91-485C-B622-22E4A4891C68}.Release|x86.ActiveCfg = Release|x86
     193    {464D70B8-2D91-485C-B622-22E4A4891C68}.Release|x86.Build.0 = Release|x86
    181194  EndGlobalSection
    182195  GlobalSection(SolutionProperties) = preSolution
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDao.cs

    r5155 r5156  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
    4 using System.Text;
    525using System.Linq.Expressions;
    626
    727namespace HeuristicLab.Services.Hive.DataAccess {
    8   using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    928  using HeuristicLab.Services.Hive.Common.DataTransfer;
    1029  using HeuristicLab.Services.Hive.DataAccess.Properties;
     30  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    1131
    1232  public class HiveDao : IHiveDao {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockAuthorizationManager.cs

    r5095 r5156  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using System;
    523
    624namespace HeuristicLab.Services.Hive.Tests.Mocks {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs

    r5095 r5156  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using System;
    223using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     24using HeuristicLab.Services.Hive.Common;
    525using HeuristicLab.Services.Hive.Common.DataTransfer;
    6 using HeuristicLab.Services.Hive.Common;
    726
    827namespace HeuristicLab.Services.Hive.Tests.Mocks {
     
    1029
    1130    public void Start() {
    12      
     31
    1332    }
    1433
    1534    public void Stop() {
    16      
     35
    1736    }
    1837
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs

    r5106 r5156  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using HeuristicLab.Services.Hive.DataAccess;
    523using HeuristicLab.Services.Hive.Tests.Mocks;
    6 using HeuristicLab.Services.Hive.DataAccess;
    724
    825namespace HeuristicLab.Services.Hive.Tests {
     
    2441    private ILifecycleManager lifecycleManager;
    2542    public ILifecycleManager LifecycleManager {
    26       get { 
    27         return defaultServiceLocator.LifecycleManager; 
     43      get {
     44        return defaultServiceLocator.LifecycleManager;
    2845      }
    2946    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/PluginLoader.cs

    r5078 r5156  
    1 
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
    222using System;
    323using System.Collections.Generic;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/ServiceTests.cs

    r5155 r5156  
    1 using System;
    2 using System.Text;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 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
     22using System;
    323using System.Collections.Generic;
    424using System.Linq;
    5 using Microsoft.VisualStudio.TestTools.UnitTesting;
     25using HeuristicLab.Clients.Hive;
     26using HeuristicLab.Clients.Hive.Slave.Tests;
    627using HeuristicLab.Services.Hive.Common.DataTransfer;
    728using HeuristicLab.Services.Hive.Common.ServiceContracts;
    8 using HeuristicLab.Clients.Hive.Slave.Tests;
    9 using HeuristicLab.Clients.Hive;
     29using Microsoft.VisualStudio.TestTools.UnitTesting;
    1030
    1131namespace HeuristicLab.Services.Hive.Tests {
    12   using DA = HeuristicLab.Services.Hive.DataAccess;
    13   using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    14   using HeuristicLab.Services.Hive.Common;
    1532  using System.Threading;
    1633  using HeuristicLab.Hive;
     34  using HeuristicLab.Services.Hive.Common;
     35  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    1736
    1837  [TestClass]
Note: See TracChangeset for help on using the changeset viewer.