Changeset 5707 for branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication
- Timestamp:
- 03/16/11 13:31:37 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/WcfService.cs
r5213 r5707 24 24 using System.IO; 25 25 using System.Runtime.Serialization.Formatters.Binary; 26 using System.ServiceModel;27 26 using HeuristicLab.Common; 28 27 using HeuristicLab.Hive.Contracts; … … 31 30 using HeuristicLab.Hive.Slave.Common; 32 31 using HeuristicLab.Hive.Slave.Communication.SlaveFacade; 32 using HeuristicLab.Hive.Tracing; 33 33 using HeuristicLab.PluginInfrastructure; 34 using HeuristicLab.Hive.Tracing;35 using HeuristicLab.Clients.Common;36 34 37 35 namespace HeuristicLab.Hive.Slave.Communication { … … 77 75 public void Connect(SlaveDto slaveInfo) { 78 76 RegisterServiceEvents(); 79 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {77 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 80 78 try { 81 79 Logger.Debug("Starting the Connection Process"); … … 131 129 public event System.EventHandler<EventArgs<Exception>> GetJobFailed; 132 130 public void GetJobAsync(Guid guid) { 133 Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService();131 DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService(); 134 132 Logger.Debug("STARTED: Fetching of Jobs from Server for Slave"); 135 133 service.Obj.BeginGetStreamedJob(guid, (ar => { … … 184 182 public event System.EventHandler<StoreFinishedJobResultCompletedEventArgs> GetFinishedJobResultCompleted; 185 183 public void GetFinishedJobResultAsync(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception, bool finished) { 186 Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService();184 DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService(); 187 185 Logger.Debug("STARTED: Sending back the finished job results"); 188 186 Logger.Debug("Building stream"); … … 218 216 public event System.EventHandler<ProcessSnapshotCompletedEventArgs> ProcessSnapshotCompleted; 219 217 public void ProcessSnapshotAsync(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception, bool finished) { 220 Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService();218 DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService(); 221 219 222 220 Stream stream = GetStreamedJobResult(clientId, jobId, result, executionTime, exception); … … 249 247 public event EventHandler<ProcessHeartBeatCompletedEventArgs> ProcessHeartBeatCompleted; 250 248 public void ProcessHeartBeatSync(HeartBeatData hbd) { 251 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.SlaveFacadePool.GetService()) {249 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.SlaveFacadePool.GetService()) { 252 250 Logger.Debug("STARTING: sending heartbeat"); 253 251 var res = service.Obj.ProcessHeartBeat(hbd); … … 287 285 288 286 public ResponseResultReceived StoreFinishedJobResultsSync(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception, bool finished) { 289 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {287 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 290 288 ResponseResultReceived res = service.Obj.StoreFinishedJobResultStreamed(GetStreamedJobResult(clientId, jobId, result, executionTime, exception)); 291 289 return res; … … 296 294 try { 297 295 Logger.Debug("STARTING: Sync call: IsJobStillNeeded"); 298 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {296 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 299 297 Response res = service.Obj.IsJobStillNeeded(jobId); 300 298 Logger.Debug("ENDED: Sync call: IsJobStillNeeded"); … … 310 308 public ResponseResultReceived ProcessSnapshotSync(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception) { 311 309 try { 312 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {310 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 313 311 return service.Obj.ProcessSnapshotStreamed(GetStreamedJobResult(clientId, jobId, result, executionTime, exception)); 314 312 } … … 322 320 public IEnumerable<CachedHivePluginInfoDto> RequestPlugins(List<HivePluginInfoDto> requestedPlugins) { 323 321 try { 324 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {322 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 325 323 Logger.Debug("STARTED: Requesting Plugins for Job"); 326 324 Logger.Debug("STARTED: Getting the stream"); … … 345 343 try { 346 344 Logger.Debug("STARTED: Logout"); 347 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {345 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 348 346 service.Obj.Logout(guid); 349 347 } … … 358 356 try { 359 357 Logger.Debug("STARTED: Syncing Calendars"); 360 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {358 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 361 359 ResponseCalendar cal = service.Obj.GetCalendar(clientId); 362 360 Logger.Debug("ENDED: Syncing Calendars"); … … 373 371 try { 374 372 Logger.Debug("STARTED: Setting Calendar status to: " + state); 375 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {373 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 376 374 Response resp = service.Obj.SetCalendarStatus(clientId, state); 377 375 Logger.Debug("ENDED: Setting Calendar status to: " + state); … … 388 386 try { 389 387 Logger.Debug("STARTED: Add Child Job for parent: " + parentJobId); 390 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {388 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 391 389 ResponseObject<JobDto> response = service.Obj.AddChildJob(parentJobId, serializedJob); 392 390 Logger.Debug("ENDED: Add Child Job for parent: " + parentJobId); … … 403 401 try { 404 402 Logger.Debug("STARTED: Pausing job: " + serializedJob.JobInfo.Id); 405 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {403 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 406 404 ResponseObject<JobDto> response = service.Obj.PauseJob(serializedJob); 407 405 Logger.Debug("ENDED: Pausing job: " + serializedJob.JobInfo.Id); … … 418 416 try { 419 417 Logger.Debug("STARTED: GetChildJobs job: " + parentJob); 420 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {418 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 421 419 SerializedJobList serializedJobs = new SerializedJobList(); 422 420 JobResult[] results = service.Obj.GetChildJobResults(new Guid?(parentJob), false, false); … … 439 437 public void DeleteChildJobs(Guid jobId) { 440 438 try { 441 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {439 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 442 440 service.Obj.DeleteChildJobs(jobId); 443 441 } … … 450 448 public HivePluginFile GetConfigurationFile() { 451 449 try { 452 using (Disposable <SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) {450 using (DisposableWrapper<SlaveFacade.ISlaveFacade> service = ServiceLocator.Instance.StreamedSlaveFacadePool.GetService()) { 453 451 var response = service.Obj.GetConfigurationFile(); 454 452 return response.Obj;
Note: See TracChangeset
for help on using the changeset viewer.