Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockHiveService.cs	(revision 5405)
@@ -215,5 +215,5 @@
 
     #region Login Methods
-    public void Hello(Guid slaveId, string name, int cores, int memory) {
+    public void Hello(HeuristicLab.Services.Hive.Common.DataTransfer.Slave slaveInfo) {
       // do nothing
     }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockServiceLocator.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockServiceLocator.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/Mocks/MockServiceLocator.cs	(revision 5405)
@@ -34,4 +34,8 @@
       return new Disposable<IHiveService>(service);
     }
+
+    public Disposable<IHiveService> GetService(string username, string password) {
+      return GetService();
+    }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs	(revision 5405)
@@ -75,9 +75,9 @@
     /// </summary>
     public void Connect(HeuristicLab.Services.Hive.Common.DataTransfer.Slave slaveInfo) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           ConnState = NetworkEnum.WcfConnState.Connected;
           ConnectedSince = DateTime.Now;
-          service.Obj.Hello(slaveInfo.Id/*Settings.Default.Guid*/, slaveInfo.Name, slaveInfo.Cores.Value, slaveInfo.Memory.Value);
+          service.Obj.Hello(slaveInfo);
           OnConnected();
         }
@@ -92,5 +92,5 @@
     /// </summary>
     public void Disconnect() {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           service.Obj.GoodBye(ConfigManager.Instance.GetClientInfo().Id);
@@ -116,5 +116,5 @@
     /// </summary>
     public Job GetJob(Guid jobId) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           Job job = service.Obj.GetJob(jobId);
@@ -129,5 +129,5 @@
 
     public JobData GetJobData(Guid jobId) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           JobData jobData = service.Obj.GetJobData(jobId);
@@ -147,5 +147,5 @@
     /// <param name="jobData"></param>    
     public void UpdateJob(Job job, JobData jobData) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           service.Obj.UpdateJob(job, jobData);
@@ -158,5 +158,5 @@
 
     public List<MessageContainer> SendHeartbeat(Heartbeat heartbeat) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           List<MessageContainer> msg = service.Obj.Heartbeat(heartbeat);
@@ -171,5 +171,5 @@
 
     public IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           IEnumerable<PluginData> msg = service.Obj.GetPluginDatas(pluginIds);
@@ -184,5 +184,5 @@
 
     public IEnumerable<Plugin> GetPlugins() {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           IEnumerable<Plugin> msg = service.Obj.GetPlugins();
@@ -197,5 +197,5 @@
 
     public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           Guid msg = service.Obj.AddChildJob(parentJobId, job, jobData);
@@ -210,5 +210,5 @@
 
     public IEnumerable<JobData> GetChildJobs(Guid? parentJobId) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           IEnumerable<LightweightJob> msg = service.Obj.GetLightweightChildJobs(parentJobId, false, false);
@@ -228,5 +228,5 @@
 
     public void DeleteChildJobs(Guid jobId) {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           service.Obj.DeleteChildJobs(jobId);
@@ -239,5 +239,5 @@
 
     public PluginData GetConfigurationFile() {
-      using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {
+      using (Disposable<IHiveService> service = GetSlaveService()) {
         try {
           PluginData msg = service.Obj.GetConfigurationFile();
@@ -249,4 +249,8 @@
         }
       }
+    }
+
+    private static Disposable<IHiveService> GetSlaveService() {
+      return ServiceLocator.Instance.GetService("hiveslave", "hiveslave");
     }
   }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 5405)
@@ -12,4 +12,8 @@
       return new Disposable<IHiveService>(new HiveService());
     }
+
+    public Disposable<IHiveService> GetService(string username, string password) {
+      return GetService();
+    }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/IServiceLocator.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/IServiceLocator.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/IServiceLocator.cs	(revision 5405)
@@ -26,4 +26,5 @@
   public interface IServiceLocator {
     Disposable<IHiveService> GetService();
+    Disposable<IHiveService> GetService(string username, string password);
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs	(revision 5405)
@@ -41,4 +41,8 @@
       return ClientFactory.CreateClient<IHiveService>("wsHttpBinding_IHiveService");
     }
+
+    public Disposable<IHiveService> GetService(string username, string password) {
+      return ClientFactory.CreateClient<IHiveService>("wsHttpBinding_IHiveService", null, username, password);
+    }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Heartbeat.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Heartbeat.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Heartbeat.cs	(revision 5405)
@@ -37,5 +37,5 @@
     public Dictionary<Guid, TimeSpan> JobProgress { get; set; } // TODO: define Type
     [DataMember]
-    public bool IsAllowedToCalculate { get; set; } // this is true if slave is allowed to work according to calendar
+    public bool AssignJob { get; set; } // if false, the server will not assign a new job
 
     public override string ToString() {
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Job.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Job.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Job.cs	(revision 5405)
@@ -40,4 +40,6 @@
     [DataMember]
     public List<Guid> PluginsNeededIds { get; set; }
+    [DataMember]
+    public DateTime? LastHeartbeat { get; set; }
 
     public Job() {
@@ -50,4 +52,5 @@
       this.MemoryNeeded = original.MemoryNeeded;
       this.PluginsNeededIds = new List<Guid>(original.PluginsNeededIds);
+      this.LastHeartbeat = original.LastHeartbeat;
     }
     public override IDeepCloneable Clone(Cloner cloner) {
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Slave.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Slave.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Slave.cs	(revision 5405)
@@ -50,4 +50,6 @@
     [DataMember]
     public bool IsAllowedToCalculate { get; set; }
+    [DataMember]
+    public DateTime? LastHeartbeat { get; set; }
 
     public Slave() {
@@ -62,4 +64,7 @@
       this.SlaveState = original.SlaveState;
       this.IsAllowedToCalculate = original.IsAllowedToCalculate;
+      this.OperatingSystem = original.OperatingSystem;
+      this.CpuArchitecture = original.CpuArchitecture;
+      this.LastHeartbeat = original.LastHeartbeat;
     }
     public override IDeepCloneable Clone(Cloner cloner) {
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs	(revision 5405)
@@ -76,5 +76,5 @@
     #region Login Methods
     [OperationContract]
-    void Hello(Guid slaveId, string name, int cores, int memory);
+    void Hello(Slave slave);
 
     [OperationContract]
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Convert.cs	(revision 5405)
@@ -44,5 +44,6 @@
         JobState = source.JobState,
         UserId = source.UserId,
-        PluginsNeededIds = source.RequiredPlugins.Select(x => x.PluginId).ToList()
+        PluginsNeededIds = source.RequiredPlugins.Select(x => x.PluginId).ToList(),
+        LastHeartbeat = source.LastHeartbeat        
       };
     }
@@ -67,5 +68,6 @@
         target.JobState = source.JobState;
         target.UserId = source.UserId;
-        // RequiredPlugins need to be added by Dao
+        target.LastHeartbeat = source.LastHeartbeat;
+        // RequiredPlugins are added by Dao
       }
     }
@@ -143,5 +145,19 @@
     public static DT.Slave ToDto(Slave source) {
       if (source == null) return null;
-      return new DT.Slave { Id = source.ResourceId, ParentResourceId = source.ParentResourceId, Cores = source.Cores, CpuSpeed = source.CpuSpeed, FreeCores = source.FreeCores, FreeMemory = source.FreeMemory, IsAllowedToCalculate = source.IsAllowedToCalculate, Memory = source.Memory, Name = source.Name, SlaveState = source.SlaveState, CpuArchitecture = source.CpuArchitecture, OperatingSystem = source.OperatingSystem };
+      return new DT.Slave { 
+        Id = source.ResourceId, 
+        ParentResourceId = source.ParentResourceId, 
+        Cores = source.Cores,
+        CpuSpeed = source.CpuSpeed, 
+        FreeCores = source.FreeCores, 
+        FreeMemory = source.FreeMemory, 
+        IsAllowedToCalculate = source.IsAllowedToCalculate, 
+        Memory = source.Memory, 
+        Name = source.Name, 
+        SlaveState = source.SlaveState, 
+        CpuArchitecture = source.CpuArchitecture, 
+        OperatingSystem = source.OperatingSystem,
+        LastHeartbeat = source.LastHeartbeat
+      };
     }
     public static Slave ToEntity(DT.Slave source) {
@@ -152,5 +168,17 @@
     public static void ToEntity(DT.Slave source, Slave target) {
       if ((source != null) && (target != null)) {
-        target.ResourceId = source.Id; target.ParentResourceId = source.ParentResourceId; target.Cores = source.Cores; target.CpuSpeed = source.CpuSpeed; target.FreeCores = source.FreeCores; target.FreeMemory = source.FreeMemory; target.IsAllowedToCalculate = source.IsAllowedToCalculate; target.Memory = source.Memory; target.Name = source.Name; target.SlaveState = source.SlaveState; target.CpuArchitecture = source.CpuArchitecture; target.OperatingSystem = source.OperatingSystem;
+        target.ResourceId = source.Id;
+        target.ParentResourceId = source.ParentResourceId;
+        target.Cores = source.Cores; 
+        target.CpuSpeed = source.CpuSpeed;
+        target.FreeCores = source.FreeCores;
+        target.FreeMemory = source.FreeMemory; 
+        target.IsAllowedToCalculate = source.IsAllowedToCalculate;
+        target.Memory = source.Memory;
+        target.Name = source.Name; 
+        target.SlaveState = source.SlaveState; 
+        target.CpuArchitecture = source.CpuArchitecture; 
+        target.OperatingSystem = source.OperatingSystem;
+        target.LastHeartbeat = source.LastHeartbeat;
       }
     }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml	(revision 5405)
@@ -50,5 +50,6 @@
         <Column Name="IsAllowedToCalculate" Type="System.Boolean" DbType="Bit" CanBeNull="false" />
         <Column Name="CpuArchitecture" Type="global::HeuristicLab.Services.Hive.Common.DataTransfer.CpuArchitecture" DbType="VarChar(3)" CanBeNull="false" />
-        <Column Name="OperatingSystem" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" />
+        <Column Name="OperatingSystem" Type="System.String" DbType="VarChar(MAX)" CanBeNull="false" UpdateCheck="Never" />
+        <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
         <Association Name="Slave_Job" Member="Jobs" ThisKey="ResourceId" OtherKey="SlaveId" Type="Job" />
       </Type>
@@ -72,4 +73,5 @@
       <Column Name="CoresNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
       <Column Name="MemoryNeeded" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />
+      <Column Name="LastHeartbeat" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />
       <Association Name="Job_AssignedResource" Member="AssignedResources" ThisKey="JobId" OtherKey="JobId" Type="AssignedResource" />
       <Association Name="Job_RequiredPlugin" Member="RequiredPlugins" ThisKey="JobId" OtherKey="JobId" Type="RequiredPlugin" />
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.dbml.layout	(revision 5405)
@@ -27,8 +27,8 @@
       </nestedChildShapes>
     </classShape>
-    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.5016097005208326">
+    <classShape Id="695bfc39-59f3-4e60-8644-f847964bf62c" absoluteBounds="6.5, 1, 2, 3.6939111328124996">
       <DataClassMoniker Name="/HiveDataContext/Job" />
       <nestedChildShapes>
-        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 2.941609700520833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="a6a30e11-03d1-4869-82e6-b733f4ef9974" absoluteBounds="6.5150000000000006, 1.46, 1.9700000000000002, 3.1339111328125" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
@@ -45,8 +45,8 @@
       </nestedChildShapes>
     </classShape>
-    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="8.875, 1, 2, 2.7324039713541666">
+    <classShape Id="26f4edfa-91dd-4941-a058-359f89e567a8" absoluteBounds="8.875, 0.75, 2, 2.9247054036458331">
       <DataClassMoniker Name="/HiveDataContext/Slave" />
       <nestedChildShapes>
-        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="8.89, 1.46, 1.9700000000000002, 2.1724039713541665" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
+        <elementListCompartment Id="1e61f36b-08dc-4df7-8594-c9dcd95c0791" absoluteBounds="8.89, 1.21, 1.9700000000000002, 2.364705403645833" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
       </nestedChildShapes>
     </classShape>
@@ -76,5 +76,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8.5 : 4.12580485026042); (8.875 : 4.12580485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(8.5 : 4.22195556640625); (8.875 : 4.22195556640625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_AssignedResource" />
       <nodes>
@@ -83,5 +83,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(7.1210551923077 : 4.50160970052083); (7.1210551923077 : 5.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(7.0898076923077 : 4.6939111328125); (7.0898076923077 : 5.5)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_RequiredPlugin" />
       <nodes>
@@ -90,5 +90,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8.3334359271285 : 4.50160970052083); (8.3334359271285 : 4.58410970052083); (8.4156121961154 : 4.58410970052083); (8.4156121961154 : 4.75160970052083); (7.8046153846154 : 4.75160970052083); (7.8046153846154 : 4.50160970052083)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(7.20923076923077 : 1); (7.20923076923077 : 0.75); (7.80461538461539 : 0.75); (7.80461538461539 : 1)]" manuallyRouted="true" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_Job" />
       <nodes>
@@ -97,5 +97,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(8.875 : 2.36620198567708); (8.5 : 2.36620198567708)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(8.875 : 2.33735270182292); (8.5 : 2.33735270182292)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Slave/Slave_Job" />
       <nodes>
@@ -111,5 +111,5 @@
       </nodes>
     </associationConnector>
-    <associationConnector edgePoints="[(6.5 : 3.56330485026042); (6.125 : 3.56330485026042)]" fixedFrom="NotFixed" fixedTo="NotFixed">
+    <associationConnector edgePoints="[(6.5 : 3.65945556640625); (6.125 : 3.65945556640625)]" fixedFrom="NotFixed" fixedTo="NotFixed">
       <AssociationMoniker Name="/HiveDataContext/Job/Job_HiveExperiment" />
       <nodes>
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HiveDataContext.designer.cs	(revision 5405)
@@ -1064,4 +1064,6 @@
 		private string _OperatingSystem;
 		
+		private System.Nullable<System.DateTime> _LastHeartbeat;
+		
 		private EntitySet<Job> _Jobs;
 		
@@ -1090,4 +1092,6 @@
     partial void OnOperatingSystemChanging(string value);
     partial void OnOperatingSystemChanged();
+    partial void OnLastHeartbeatChanging(System.Nullable<System.DateTime> value);
+    partial void OnLastHeartbeatChanged();
     #endregion
 		
@@ -1278,5 +1282,5 @@
 		}
 		
-		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OperatingSystem", DbType="VarChar(MAX)", CanBeNull=false)]
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OperatingSystem", DbType="VarChar(MAX)", CanBeNull=false, UpdateCheck=UpdateCheck.Never)]
 		public string OperatingSystem
 		{
@@ -1294,4 +1298,24 @@
 					this.SendPropertyChanged("OperatingSystem");
 					this.OnOperatingSystemChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastHeartbeat", DbType="DateTime")]
+		public System.Nullable<System.DateTime> LastHeartbeat
+		{
+			get
+			{
+				return this._LastHeartbeat;
+			}
+			set
+			{
+				if ((this._LastHeartbeat != value))
+				{
+					this.OnLastHeartbeatChanging(value);
+					this.SendPropertyChanging();
+					this._LastHeartbeat = value;
+					this.SendPropertyChanged("LastHeartbeat");
+					this.OnLastHeartbeatChanged();
 				}
 			}
@@ -1372,4 +1396,6 @@
 		
 		private int _MemoryNeeded;
+		
+		private System.Nullable<System.DateTime> _LastHeartbeat;
 		
 		private EntitySet<AssignedResource> _AssignedResources;
@@ -1417,4 +1443,6 @@
     partial void OnMemoryNeededChanging(int value);
     partial void OnMemoryNeededChanged();
+    partial void OnLastHeartbeatChanging(System.Nullable<System.DateTime> value);
+    partial void OnLastHeartbeatChanged();
     #endregion
 		
@@ -1710,4 +1738,24 @@
 					this.SendPropertyChanged("MemoryNeeded");
 					this.OnMemoryNeededChanged();
+				}
+			}
+		}
+		
+		[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_LastHeartbeat", DbType="DateTime")]
+		public System.Nullable<System.DateTime> LastHeartbeat
+		{
+			get
+			{
+				return this._LastHeartbeat;
+			}
+			set
+			{
+				if ((this._LastHeartbeat != value))
+				{
+					this.OnLastHeartbeatChanging(value);
+					this.SendPropertyChanging();
+					this._LastHeartbeat = value;
+					this.SendPropertyChanged("LastHeartbeat");
+					this.OnLastHeartbeatChanged();
 				}
 			}
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/DaoTests.cs	(revision 5405)
@@ -76,10 +76,21 @@
 
       DT.Slave slave = new DT.Slave() {
+        Id = Guid.NewGuid(),
         Name = "Test",
-        OperatingSystem = Environment.OSVersion.VersionString,
+        OperatingSystem = null, //"Windows 3.11",
         Cores = 2,
-        Memory = 1024
+        Memory = 1024,
+        FreeMemory = 512
       };
-      slave.Id= dao.AddSlave(slave);
+
+      Assert.AreEqual(slave.Id, dao.AddSlave(slave));
+
+      // update
+      slave.FreeMemory = 255;
+      slave.OperatingSystem = Environment.OSVersion.VersionString;
+      dao.UpdateSlave(slave);
+
+      DT.Slave slaveLoaded = dao.GetSlave(slave.Id);
+      Assert.AreEqual(slave.FreeMemory, slaveLoaded.FreeMemory);
 
       dao.DeleteSlave(slave.Id);
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockLifecycleManager.cs	(revision 5405)
@@ -28,15 +28,7 @@
   public class MockLifecycleManager : ILifecycleManager {
 
-    public void Start() {
+    public void Start() { }
 
-    }
-
-    public void Stop() {
-
-    }
-
-    public List<MessageContainer> ProcessHeartbeat(Heartbeat heartbeat) {
-      throw new NotImplementedException();
-    }
+    public void Stop() { }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Tests/Mocks/MockServiceLocator.cs	(revision 5405)
@@ -39,5 +39,4 @@
     }
 
-    private ILifecycleManager lifecycleManager;
     public ILifecycleManager LifecycleManager {
       get {
@@ -50,4 +49,9 @@
     }
 
+    public HeartbeatManager HeartbeatManager {
+      get {
+        return defaultServiceLocator.HeartbeatManager;
+      }
+    }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/App_Code/HiveServerModule.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/App_Code/HiveServerModule.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/App_Code/HiveServerModule.cs	(revision 5405)
@@ -27,4 +27,5 @@
 using HeuristicLab.Services.Hive.Common.ServiceContracts;
 using HeuristicLab.Services.Hive;
+using HeuristicLab.Tracing;
 
 namespace HeuristicLab.Hive.Server.Core.IISModules {
@@ -37,8 +38,9 @@
       if (lifecycleManager == null)
         lifecycleManager = new LifecycleManager();
+      lifecycleManager.Start();
     }
 
     public void Dispose() {
-      
+      lifecycleManager.Stop();
     } 
   }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config	(revision 5405)
@@ -70,7 +70,7 @@
 
   <system.webServer>
-    <!--<modules runAllManagedModulesForAllRequests="true">
+    <modules runAllManagedModulesForAllRequests="true">
       <add name="HiveServerModule" type="HeuristicLab.Hive.Server.Core.IISModules.HiveServerModule"/>
-    </modules>-->
+    </modules>
     <directoryBrowse enabled="true"/>
   </system.webServer>
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs	(revision 5405)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeartbeatManager.cs	(revision 5405)
@@ -0,0 +1,110 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Services.Hive.Common;
+using HeuristicLab.Services.Hive.Common.DataTransfer;
+using HeuristicLab.Tracing;
+
+namespace HeuristicLab.Services.Hive {
+  public class HeartbeatManager {
+    private DataAccess.IHiveDao dao {
+      get { return ServiceLocator.Instance.HiveDao; }
+    }
+    private HeuristicLab.Services.Hive.DataAccess.TransactionManager trans {
+      get { return ServiceLocator.Instance.TransactionManager; }
+    }
+    private IAuthorizationManager auth {
+      get { return ServiceLocator.Instance.AuthorizationManager; }
+    }
+
+    /// <summary>
+    /// This method will be called every time a slave sends a heartbeat (-> very often; concurrency is important!)
+    /// </summary>
+    /// <returns>a list of actions the slave should do</returns>
+    public List<MessageContainer> ProcessHeartbeat(Heartbeat heartbeat) {
+      List<MessageContainer> actions = new List<MessageContainer>();
+      Slave slave = dao.GetSlave(heartbeat.SlaveId);
+      if (slave == null) {
+        actions.Add(new MessageContainer(MessageContainer.MessageType.SayHello));
+      } else {
+        // update slave data
+        slave.FreeCores = heartbeat.FreeCores;
+        slave.FreeMemory = heartbeat.FreeMemory;
+        slave.IsAllowedToCalculate = true; // Todo: look into calendar
+        slave.SlaveState = (heartbeat.JobProgress != null && heartbeat.JobProgress.Count > 0) ? SlaveState.Calculating : SlaveState.Idle;
+        slave.LastHeartbeat = DateTime.Now;
+        dao.UpdateSlave(slave);
+
+        // update job data
+        actions.AddRange(UpdateJobs(heartbeat));
+
+        // assign new job
+        if (heartbeat.AssignJob && this.IsAllowedToSendJobs() && slave.IsAllowedToCalculate && heartbeat.FreeCores > 0) {
+          var availableJobs = dao.GetWaitingJobs(slave, 1);
+          if (availableJobs.Count() > 0) {
+            var job = availableJobs.First();
+            actions.Add(new MessageContainer(MessageContainer.MessageType.CalculateJob, job.Id));
+            AssignJob(slave, job);
+          }
+        }
+      }
+      return actions;
+    }
+
+    private void AssignJob(Slave slave, Job job) {
+      job.SlaveId = slave.Id;
+      job.JobState = JobState.Calculating; // Todo: Maybe use State = Transferring (?)
+      job.DateCalculated = DateTime.Now; // Todo: use statelog instead
+      dao.UpdateJob(job);
+      dao.UpdateSlave(slave);
+    }
+
+    /// <summary>
+    /// Update the progress of each job
+    /// Checks if all the jobs sent by heartbeat are supposed to be calculated by this slave
+    /// </summary>
+    private IEnumerable<MessageContainer> UpdateJobs(Heartbeat heartbeat) {
+      List<MessageContainer> actions = new List<MessageContainer>();
+
+      if (heartbeat.JobProgress == null)
+        return actions;
+
+      // process the jobProgresses
+      foreach (var jobProgress in heartbeat.JobProgress) {
+        Job curJob = dao.GetJob(jobProgress.Key);
+        if (curJob == null) {
+          // job does not exist in db
+          actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, jobProgress.Key));
+          Logger.Error("Job does not exist in DB: " + jobProgress.Key);
+        } else {
+          if (curJob.SlaveId == Guid.Empty || curJob.SlaveId != heartbeat.SlaveId) {
+            // assigned slave does not match heartbeat
+            actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
+            Logger.Error("The slave " + heartbeat.SlaveId + " is not supposed to calculate Job: " + curJob);
+          } else {
+            // save job execution time
+            curJob.ExecutionTime = jobProgress.Value;
+            curJob.LastHeartbeat = DateTime.Now;
+
+            if (curJob.JobState == JobState.Aborted) {
+              // a request to abort the job has been set
+              actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
+            }
+            dao.UpdateJob(curJob);
+          }
+        }
+      }
+      return actions;
+    }
+
+    /// <summary>
+    /// Returns true if there are enough resources to send a job
+    /// There should not be too many jobs sent simultaniously
+    /// </summary>
+    private bool IsAllowedToSendJobs() {
+      return true; // JobsCurrentlyTransferring < ApplicationConstants.MaxJobTransferCount;
+      // Todo: see if unlimited job transfer count works. if not, look into db and count jobs in state Transferring
+    }
+  }
+}
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeuristicLab.Services.Hive-3.4.csproj
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeuristicLab.Services.Hive-3.4.csproj	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeuristicLab.Services.Hive-3.4.csproj	(revision 5405)
@@ -112,4 +112,5 @@
     <None Include="HeuristicLabServicesHivePlugin.cs.frame" />
     <None Include="Properties\AssemblyInfo.cs.frame" />
+    <Compile Include="HeartbeatManager.cs" />
     <Compile Include="Interfaces\ILifecycleManager.cs" />
     <Compile Include="Interfaces\IServiceLocator.cs" />
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs	(revision 5405)
@@ -25,4 +25,7 @@
     private ILifecycleManager lifecycleManager {
       get { return ServiceLocator.Instance.LifecycleManager; }
+    }
+    private HeartbeatManager heartbeatManager {
+      get { return ServiceLocator.Instance.HeartbeatManager; }
     }
 
@@ -162,15 +165,12 @@
 
     #region Login Methods
-    public void Hello(Guid slaveId, string name, int cores, int memory) {
-      using (trans.OpenTransaction()) {
-        var slave = dao.GetSlave(slaveId);
+    public void Hello(Slave slaveInfo) {
+      using (trans.OpenTransaction()) {
+        var slave = dao.GetSlave(slaveInfo.Id);
 
         if (slave == null) {
-          slave = new Slave { Id = slaveId, Name = name, Cores = cores, Memory = memory };
-          slave.IsAllowedToCalculate = true; //a little bit to optimistic?
-          slave.SlaveState = SlaveState.Idle;
-          dao.AddSlave(slave);
+          dao.AddSlave(slaveInfo);
         } else {
-          //TODO: error handling? 
+          dao.UpdateSlave(slaveInfo);
         }
       }
@@ -191,5 +191,5 @@
     public List<MessageContainer> Heartbeat(Heartbeat heartbeat) {
       using (trans.OpenTransaction()) {
-        return lifecycleManager.ProcessHeartbeat(heartbeat);
+        return heartbeatManager.ProcessHeartbeat(heartbeat);
       }
     }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/ILifecycleManager.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/ILifecycleManager.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/ILifecycleManager.cs	(revision 5405)
@@ -14,6 +14,4 @@
 
     void Stop();
-
-    List<MessageContainer> ProcessHeartbeat(Heartbeat heartbeat);
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/IServiceLocator.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/IServiceLocator.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/Interfaces/IServiceLocator.cs	(revision 5405)
@@ -12,4 +12,5 @@
     ILifecycleManager LifecycleManager { get; }
     TransactionManager TransactionManager { get; }
+    HeartbeatManager HeartbeatManager { get; }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/LifecycleManager.cs	(revision 5405)
@@ -25,43 +25,21 @@
 
     private static object locker = new object();
-    private Dictionary<Guid, DateTime> heartbeats = new Dictionary<Guid, DateTime>();
 
     // Windows-Forms timer is single threaded, so callbacks will be synchron
-    System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
+    System.Windows.Forms.Timer timer;
 
-    /// <summary>
-    /// Contains a list job JobIds which have been sent to a slave, but the slave has not yet sent 
-    /// a jobProgress of the job with a heartbeat, because he has not finished downloading/deserializing it.
-    /// The number value indicates a TimeToLive count that is decremented with each server-heartbeat.
-    /// When the number reaches zero, the jobs is assumed to be lost and is set Offline again.
-    /// </summary>
-    private Dictionary<Guid, int> newlyAssignedJobs = new Dictionary<Guid, int>();
-
-    /// <summary>
-    /// Counts how many jobs are currently beeing transferred.
-    /// </summary>
-    private int jobsCurrentlyTransfering = 0;
-    public int JobsCurrentlyTransferring {
-      get { return jobsCurrentlyTransfering; }
-      set {
-        if (jobsCurrentlyTransfering != value) {
-          jobsCurrentlyTransfering = value;
-          Logger.Info("JobsCurrentlyTransfering: " + jobsCurrentlyTransfering);
-        }
-      }
+    public ExecutionState ExecutionState {
+      get { return timer.Enabled ? ExecutionState.Started : Core.ExecutionState.Stopped; }
     }
 
-    public ExecutionState ExecutionState {
-      get { return timer.Enabled ? ExecutionState.Started : Core.ExecutionState.Stopped;  }
+    public LifecycleManager() {
+      this.timer = new System.Windows.Forms.Timer();
+      this.timer.Tick += new EventHandler(timer_Tick);
     }
-
-    public LifecycleManager() { }
 
     public void Start() {
       if (ExecutionState == Core.ExecutionState.Stopped) {
         this.timer.Interval = (int)new TimeSpan(0, 0, 10).TotalMilliseconds;
-        this.timer.Tick += new EventHandler(timer_Tick);
         this.timer.Start();
-        AddAllSlavesToHeartbeats();
       }
     }
@@ -74,21 +52,4 @@
 
     /// <summary>
-    // add all slaves to hearbeats-collection and give them some time to say hello (HEARTBEAT_TIMEOUT)
-    // otherwise alls the slaves jobs would be aborted immediately, which is not desirable if the server has just been restarted
-    /// </summary>
-    private void AddAllSlavesToHeartbeats() {
-      lock (locker) {
-        using (trans.OpenTransaction()) {
-          Guid[] slaveIds = dao.GetSlaves(x => true).Select(s => s.Id).ToArray();
-          foreach (Guid slaveId in slaveIds) {
-            if (!heartbeats.ContainsKey(slaveId)) {
-              heartbeats.Add(slaveId, DateTime.Now);
-            }
-          }
-        }
-      }
-    }
-
-    /// <summary>
     /// This method is supposed to check if slaves are online
     /// if not -> set them offline and check if they where calculating a job
@@ -97,29 +58,14 @@
       lock (locker) {
         using (trans.OpenTransaction()) {
-          Guid[] slaveIds = dao.GetSlaves(x => true).Select(s => s.Id).ToArray();
-          foreach (Guid slaveId in slaveIds) {
-            if (SlaveTimedOut(slaveId)) {
-              var slave = dao.GetSlave(slaveId);
-              if (slave.SlaveState != SlaveState.Offline) {
-                AbortJobs(slaveId);
-                slave.SlaveState = SlaveState.Offline;
-                dao.UpdateSlave(slave);
-              }
-              heartbeats.Remove(slaveId);
+          var slaves = dao.GetSlaves(x => x.SlaveState != SlaveState.Offline);
+          foreach (Slave slave in slaves) {
+            if (!slave.LastHeartbeat.HasValue || (DateTime.Now - slave.LastHeartbeat.Value).TotalSeconds > ApplicationConstants.HeartbeatTimeout) {
+              slave.SlaveState = SlaveState.Offline;
+              AbortJobs(slave.Id);
+              dao.UpdateSlave(slave);
             }
           }
         }
       }
-    }
-
-    private bool SlaveTimedOut(Guid slaveId) {
-      if (!heartbeats.ContainsKey(slaveId))
-        return true;
-
-      if ((DateTime.Now - heartbeats[slaveId]).TotalSeconds > ApplicationConstants.HeartbeatTimeout) {
-        return true;
-      }
-
-      return false;
     }
 
@@ -131,93 +77,4 @@
       }
     }
-
-    /// <summary>
-    /// This method will be called every time a slave sends a heartbeat (-> very often; concurrency is important!)
-    /// </summary>
-    /// <returns>a list of actions the slave should do</returns>
-    public List<MessageContainer> ProcessHeartbeat(Heartbeat heartbeat) {
-      List<MessageContainer> actions = new List<MessageContainer>();
-      Slave slave = dao.GetSlave(heartbeat.SlaveId);
-      if (slave == null) {
-        actions.Add(new MessageContainer(MessageContainer.MessageType.SayHello));
-      } else {
-        heartbeats[heartbeat.SlaveId] = DateTime.Now;
-        actions.AddRange(UpdateJobs(heartbeat));
-
-        if (this.IsAllowedToSendJobs() && slave.IsAllowedToCalculate && heartbeat.FreeCores > 0) {
-          var availableJobs = dao.GetWaitingJobs(slave, 1);
-          if (availableJobs.Count() > 0) {
-            var job = availableJobs.First();
-            actions.Add(new MessageContainer(MessageContainer.MessageType.CalculateJob, job.Id));
-            AssignJob(slave, job);
-          }
-        }
-
-        if (slave.FreeCores != heartbeat.FreeCores ||
-            slave.FreeMemory != heartbeat.FreeMemory ||
-            slave.IsAllowedToCalculate != heartbeat.IsAllowedToCalculate ||
-            slave.SlaveState != (heartbeat.JobProgress.Count > 0 ? SlaveState.Calculating : SlaveState.Idle)) { // only update slave when something changed, to avoid unnecessary updates
-          slave.FreeCores = heartbeat.FreeCores;
-          slave.FreeMemory = heartbeat.FreeMemory;
-          slave.IsAllowedToCalculate = heartbeat.IsAllowedToCalculate;
-          slave.SlaveState = (heartbeat.JobProgress != null && heartbeat.JobProgress.Count > 0) ? SlaveState.Calculating : SlaveState.Idle;
-          dao.UpdateSlave(slave);
-        }
-      }
-      return actions;
-    }
-
-    private void AssignJob(Slave slave, Job job) {
-      job.SlaveId = slave.Id;
-      job.JobState = JobState.Calculating; // Todo: Maybe use State = Transferring (?)
-      job.DateCalculated = DateTime.Now; // Todo: use statelog instead
-      dao.UpdateJob(job);
-      dao.UpdateSlave(slave);
-    }
-
-    /// <summary>
-    /// Update the progress of each job
-    /// Checks if all the jobs sent by heartbeat are supposed to be calculated by this slave
-    /// </summary>
-    private IEnumerable<MessageContainer> UpdateJobs(Heartbeat heartbeat) {
-      List<MessageContainer> actions = new List<MessageContainer>();
-
-      if (heartbeat.JobProgress == null)
-        return actions;
-
-      // process the jobProgresses
-      foreach (var jobProgress in heartbeat.JobProgress) {
-        Job curJob = dao.GetJob(jobProgress.Key);
-        if (curJob == null) {
-          // job does not exist in db
-          actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, jobProgress.Key));
-          Logger.Error("Job does not exist in DB: " + jobProgress.Key);
-        } else {
-          if (curJob.SlaveId == Guid.Empty || curJob.SlaveId != heartbeat.SlaveId) {
-            // assigned slave does not match heartbeat
-            actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
-            Logger.Error("The slave " + heartbeat.SlaveId + " is not supposed to calculate Job: " + curJob);
-          } else {
-            // save job execution time
-            curJob.ExecutionTime = jobProgress.Value;
-
-            if (curJob.JobState == JobState.Aborted) {
-              // a request to abort the job has been set
-              actions.Add(new MessageContainer(MessageContainer.MessageType.AbortJob, curJob.Id));
-            }
-            dao.UpdateJob(curJob);
-          }
-        }
-      }
-      return actions;
-    }
-
-    /// <summary>
-    /// Returns true if there are enough resources to send a job
-    /// There should not be too many jobs sent simultaniously
-    /// </summary>
-    private bool IsAllowedToSendJobs() {
-      return JobsCurrentlyTransferring < ApplicationConstants.MaxJobTransferCount;
-    }
   }
 }
Index: /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/ServiceLocator.cs
===================================================================
--- /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/ServiceLocator.cs	(revision 5404)
+++ /branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/ServiceLocator.cs	(revision 5405)
@@ -48,4 +48,12 @@
       }
     }
+
+    private HeartbeatManager heartbeatManager;
+    public HeartbeatManager HeartbeatManager {
+      get {
+        if(heartbeatManager == null) heartbeatManager = new HeartbeatManager();
+        return heartbeatManager;
+      }
+    }
   }
 }
