Changeset 1449 for trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
- Timestamp:
- 03/27/09 14:04:47 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r1379 r1449 52 52 public class Core: MarshalByRefObject { 53 53 public static bool abortRequested { get; set; } 54 55 private Dictionary< long, Executor> engines = new Dictionary<long, Executor>();56 private Dictionary< long, AppDomain> appDomains = new Dictionary<long, AppDomain>();57 private Dictionary< long, Job> jobs = new Dictionary<long, Job>();54 55 private Dictionary<Guid, Executor> engines = new Dictionary<Guid, Executor>(); 56 private Dictionary<Guid, AppDomain> appDomains = new Dictionary<Guid, AppDomain>(); 57 private Dictionary<Guid, Job> jobs = new Dictionary<Guid, Job>(); 58 58 59 59 private WcfService wcfService; … … 129 129 //Pull a Job from the Server 130 130 case MessageContainer.MessageType.FetchJob: 131 wcfService.SendJobAsync(ConfigManager.Instance.GetClientInfo(). ClientId);131 wcfService.SendJobAsync(ConfigManager.Instance.GetClientInfo().Id); 132 132 break; 133 133 //A Job has finished and can be sent back to the server … … 147 147 148 148 private void GetFinishedJob(object jobId) { 149 long jId = (long)jobId;149 Guid jId = (Guid)jobId; 150 150 try { 151 151 byte[] sJob = engines[jId].GetFinishedJob(); 152 152 153 153 if (WcfService.Instance.ConnState == NetworkEnum.WcfConnState.Loggedin) { 154 wcfService.StoreFinishedJobResultAsync(ConfigManager.Instance.GetClientInfo(). ClientId,154 wcfService.StoreFinishedJobResultAsync(ConfigManager.Instance.GetClientInfo().Id, 155 155 jId, 156 156 sJob, … … 174 174 175 175 private void GetSnapshot(object jobId) { 176 long jId = (long)jobId;176 Guid jId = (Guid)jobId; 177 177 byte[] obj = engines[jId].GetSnapshot(); 178 wcfService.ProcessSnapshotAsync(ConfigManager.Instance.GetClientInfo(). ClientId,178 wcfService.ProcessSnapshotAsync(ConfigManager.Instance.GetClientInfo().Id, 179 179 jId, 180 180 obj, … … 249 249 Logging.Instance.Info(this.ToString(), "ServerChanged has been called"); 250 250 lock (engines) { 251 foreach (KeyValuePair< long, AppDomain> entries in appDomains)251 foreach (KeyValuePair<Guid, AppDomain> entries in appDomains) 252 252 AppDomain.Unload(appDomains[entries.Key]); 253 appDomains = new Dictionary< long, AppDomain>();254 engines = new Dictionary< long, Executor>();253 appDomains = new Dictionary<Guid, AppDomain>(); 254 engines = new Dictionary<Guid, Executor>(); 255 255 } 256 256 } … … 265 265 Logging.Instance.Info(this.ToString(), "Reconnected to old server - checking currently running appdomains"); 266 266 267 foreach (KeyValuePair< long, Executor> execKVP in engines) {267 foreach (KeyValuePair<Guid, Executor> execKVP in engines) { 268 268 if (!execKVP.Value.Running && execKVP.Value.CurrentMessage == MessageContainer.MessageType.NoMessage) { 269 269 Logging.Instance.Info(this.ToString(), "Checking for JobId: " + execKVP.Value.JobId); … … 276 276 #endregion 277 277 278 public Dictionary< long, Executor> GetExecutionEngines() {278 public Dictionary<Guid, Executor> GetExecutionEngines() { 279 279 return engines; 280 280 }
Note: See TracChangeset
for help on using the changeset viewer.