- Timestamp:
- 09/17/10 10:26:55 (14 years ago)
- Location:
- branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3
- Files:
-
- 2 added
- 1 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/ApplicationConstants.cs
r4264 r4423 39 39 40 40 public static int JOB_TIME_TO_LIVE = 5; 41 42 /// <summary> 43 /// Interval in which the HL.HiveExperiment will poll results from server 44 /// </summary> 45 public static TimeSpan RESULT_POLLING_INTERVAL = new TimeSpan(0, 0, 5); 46 47 /// <summary> 48 /// Maximum number of jobs that the server should send/receive simultaniously 49 /// </summary> 50 public static int MAX_JOB_TRANSFER_COUNT = 6; 41 51 } 42 52 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/HeartBeatData.cs
r4264 r4423 37 37 public int FreeCores { get; set; } 38 38 [DataMember] 39 public Dictionary<Guid, double> JobProgress { get; set; } // TODO: define Type39 public Dictionary<Guid, TimeSpan> JobProgress { get; set; } // TODO: define Type 40 40 [DataMember] 41 41 public bool IsAllowedToCalculate { get; set; } // this is true if slave is allowed to work according to calendar … … 43 43 public override string ToString() { 44 44 String val = "SlaveId: " + SlaveId + ", FreeCores: " + FreeCores; 45 foreach (KeyValuePair<Guid, double> kvp in JobProgress) {46 val += "\nId" + kvp.Key + " Progress" + kvp.Value;45 foreach (KeyValuePair<Guid, TimeSpan> kvp in JobProgress) { 46 val += "\nId" + kvp.Key + " ExecutionTime " + kvp.Value; 47 47 } 48 48 return val; -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/JobDto.cs
r4368 r4423 41 41 [Storable] 42 42 [DataMember] 43 public Guid ?UserId { get; set; }43 public Guid UserId { get; set; } 44 44 [Storable] 45 45 [DataMember] … … 47 47 [Storable] 48 48 [DataMember] 49 public JobDto ParentJob{ get; set; }49 public Guid? ParentJobId { get; set; } 50 50 [Storable] 51 51 [DataMember] 52 public double? Percentage { get; set; }52 public TimeSpan ExecutionTime { get; set; } 53 53 [Storable] 54 54 [DataMember] … … 104 104 clone.Id = this.Id; 105 105 clone.MemoryNeeded = this.MemoryNeeded; 106 clone.ParentJob = (JobDto)cloner.Clone(this.ParentJob);107 clone. Percentage = this.Percentage;106 clone.ParentJobId = this.ParentJobId; 107 clone.ExecutionTime = this.ExecutionTime; 108 108 clone.PluginsNeeded = (from p in this.PluginsNeeded 109 109 select (HivePluginInfoDto)cloner.Clone(p)).ToList(); -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/JobResult.cs
r4368 r4423 44 44 [Storable] 45 45 [DataMember] 46 public double? Percentage { get; set; }46 public TimeSpan ExecutionTime { get; set; } 47 47 [Storable] 48 48 [DataMember] … … 68 68 clone.DateFinished = this.DateFinished; 69 69 clone.Exception = this.Exception; 70 clone. Percentage = this.Percentage;70 clone.ExecutionTime = this.ExecutionTime; 71 71 clone.State = this.State; 72 72 clone.ParentJobId = this.ParentJobId; -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/JobState.cs
r4368 r4423 6 6 namespace HeuristicLab.Hive.Contracts.BusinessObjects { 7 7 public enum JobState { 8 /// <summary> 9 /// Job is actively calculated on a Slave 10 /// </summary> 8 11 Calculating, 12 13 /// <summary> 14 /// Job is waiting to be calculated 15 /// </summary> 9 16 Offline, 17 18 /// <summary> 19 /// Job as finished and is ready to be collected by the Client 20 /// </summary> 10 21 Finished, 22 23 /// <summary> 24 /// Job is aborted and result can be collected by the Client 25 /// </summary> 11 26 Aborted, 27 28 /// <summary> 29 /// A snapshot has been requested. The calculating slave is responsible for pausing the Job and sending the snapshot to the server. After that state will be SnapshotSent 30 /// </summary> 12 31 SnapshotRequested, 32 33 /// <summary> 34 /// Snapshot has been sent to the server and its calculating again (should'nt it be back to Calculating again?) 35 /// </summary> 13 36 SnapshotSent, 37 38 /// <summary> 39 /// ??? 40 /// </summary> 14 41 Pending, 42 43 /// <summary> 44 /// Job as been aborted due to an error. Results are ready to be collected 45 /// </summary> 15 46 Failed, 47 48 /// <summary> 49 /// The job is paused and waits on the server to be sent back to a Slave when all of its child jobs are Finished. 50 /// </summary> 16 51 WaitForChildJobs 17 52 }; -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/SerializedJob.cs
r4133 r4423 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 using HeuristicLab.Common; 29 using System.IO; 30 using HeuristicLab.Persistence.Default.Xml; 31 using HeuristicLab.Hive.JobBase; 29 32 30 33 namespace HeuristicLab.Hive.Contracts.BusinessObjects { … … 52 55 return Clone(new Cloner()); 53 56 } 57 58 public static byte[] Serialize(object obj) { 59 MemoryStream memStream = new MemoryStream(); 60 XmlGenerator.Serialize(obj, memStream); 61 byte[] jobByteArray = memStream.ToArray(); 62 memStream.Dispose(); 63 return jobByteArray; 64 } 65 66 public static T Deserialize<T>(byte[] sjob) { 67 MemoryStream memStream = new MemoryStream(sjob); 68 T job = XmlParser.Deserialize<T>(memStream); 69 memStream.Dispose(); 70 return job; 71 } 54 72 } 55 73 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/SlaveDto.cs
r4267 r4423 35 35 [Storable] 36 36 [DataMember] 37 public int NrOfCores { get; set; }37 public int? NrOfCores { get; set; } 38 38 [Storable] 39 39 [DataMember] 40 public int NrOfFreeCores { get; set; }40 public int? NrOfFreeCores { get; set; } 41 41 [Storable] 42 42 [DataMember] … … 44 44 [Storable] 45 45 [DataMember] 46 public int Memory { get; set; }46 public int? Memory { get; set; } 47 47 [Storable] 48 48 [DataMember] 49 public int FreeMemory { get; set; }49 public int? FreeMemory { get; set; } 50 50 [Storable] 51 51 [DataMember] -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Disposable.cs
r4368 r4423 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 using System; 2 22 3 23 namespace HeuristicLab.Hive.Contracts { -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/HeuristicLab.Hive.Contracts-3.3.csproj
r4368 r4423 119 119 <Compile Include="BusinessObjects\CachedHivePluginInfoDto.cs" /> 120 120 <Compile Include="BusinessObjects\CalendarState.cs" /> 121 <Compile Include="BusinessObjects\HiveExperimentDtoList.cs" /> 122 <Compile Include="BusinessObjects\HiveExperimentDto.cs" /> 121 123 <Compile Include="BusinessObjects\SerializedJobList.cs" /> 122 124 <Compile Include="BusinessObjects\SlaveGroupDto.cs" /> -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/HiveRoles.cs
r4302 r4423 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 using System; 2 22 using System.Collections.Generic; 3 23 using System.Linq; -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/IClientFacade.cs
r4368 r4423 49 49 [OperationContract] 50 50 ResponseObject<JobResultList> GetChildJobResults(Guid? parentJobId, bool recursive, bool includeParent); 51 52 /// <summary> 53 /// Returns all experiments for the current user 54 /// </summary> 55 [OperationContract] 56 ResponseObject<HiveExperimentDtoList> GetHiveExperiments(); 57 58 [OperationContract] 59 ResponseObject<HiveExperimentDto> UpdateHiveExperiment(HiveExperimentDto hiveExperimentDto); 60 61 [OperationContract] 62 Response DeleteHiveExperiment(Guid hiveExperimentId); 63 64 [OperationContract] 65 ResponseObject<JobDto> AddChildJob(Guid parentJobId, SerializedJob serializedJob); 51 66 } 52 67 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/IJobManager.cs
r4368 r4423 97 97 [OperationContract] 98 98 ResponseObject<JobDto> PauseJob(SerializedJob serializedJob); 99 100 [OperationContract] 101 ResponseObject<HiveExperimentDtoList> GetHiveExperiments(); 102 103 [OperationContract] 104 ResponseObject<HiveExperimentDto> UpdateHiveExperiment(HiveExperimentDto hiveExperimentDto); 105 106 [OperationContract] 107 Response DeleteHiveExperiment(Guid hiveExperimentId); 108 109 [OperationContract] 110 Response DeleteChildJobs(Guid jobId); 99 111 } 100 112 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/ILifecycleManager.cs
r1468 r4423 26 26 using HeuristicLab.DataAccess.Interfaces; 27 27 28 namespace HeuristicLab.Hive.Contracts.Interfaces { 28 namespace HeuristicLab.Hive.Contracts.Interfaces { 29 29 /// <summary> 30 30 /// Manages the lifecycle of the application 31 31 /// </summary> 32 public interface ILifecycleManager { 32 public interface ILifecycleManager { 33 33 /// <summary> 34 34 /// Initializes the application 35 35 /// </summary> 36 void Init(); 37 38 /// <summary> 39 /// The server heartbeat 40 /// </summary> 41 void RegisterHeartbeat(EventHandler handler); 42 43 /// <summary> 44 /// The startup event 45 /// </summary> 46 void RegisterStartup(EventHandler handler); 47 48 /// <summary> 49 /// The shutdown event 50 /// </summary> 51 void RegisterShutdown(EventHandler handler); 36 void Start(); 52 37 53 38 /// <summary> 54 39 /// Shuts the application down 55 40 /// </summary> 56 void Shutdown(); 41 void Stop(); 42 43 /// <summary> 44 /// The number of jobs which are transferred at the moment 45 /// </summary> 46 int JobsCurrentlyTransferring { get; set; } 47 48 event EventHandler ServerHeartbeat; 49 50 event EventHandler Started; 51 52 event EventHandler Stopped; 57 53 } 58 54 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/ISlaveCommunicator.cs
r4368 r4423 50 50 51 51 [OperationContract] 52 ResponseResultReceived StoreFinishedJobResult(Guid clientId, Guid jobId, byte[] result, double percentage, string exception);52 ResponseResultReceived StoreFinishedJobResult(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception); 53 53 54 54 [OperationContract] 55 ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, double percentage, string exception);55 ResponseResultReceived ProcessSnapshot(Guid clientId, Guid jobId, byte[] result, TimeSpan executionTime, string exception); 56 56 57 57 [OperationContract] -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/Interfaces/ISlaveFacade.cs
r4368 r4423 56 56 [OperationContract] 57 57 SerializedJob GetLastSerializedResult(Guid jobId); 58 59 [OperationContract] 60 Response DeleteChildJobs(Guid jobId); 58 61 } 59 62 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/MessageContainer.cs
r4368 r4423 40 40 FetchOrForceFetchCalendar, AddChildJob, 41 41 PauseJob, 42 GetChildJobs 42 GetChildJobs, 43 DeleteChildJobs 43 44 }; 44 45 -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/MessageContainerWithCallback.cs
r4368 r4423 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 using System; 2 22 using HeuristicLab.Common; 3 23 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/ResponseStatus.cs
r4368 r4423 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 using System; 2 22 using System.Collections.Generic; 3 23 using System.Linq; … … 5 25 6 26 namespace HeuristicLab.Hive.Contracts { 7 /// <summary>8 /// [chn] todo: make names consistent: NotFound, DoesNotExist, NotAvailable, ...9 /// </summary>10 27 public enum ResponseStatus { 11 28 Ok, … … 18 35 GetJobByIdWithDetails_JobDoesNotExist, // ApplicationConstants.RESPONSE_JOB_JOB_DOESNT_EXIST 19 36 20 AddNewJob_ JobStateMustBeOffline, // ApplicationConstants.RESPONSE_JOB_JOBSTATE_MUST_BE_OFFLINE37 AddNewJob_InvalidJobState, // ApplicationConstants.RESPONSE_JOB_JOBSTATE_MUST_BE_OFFLINE 21 38 AddNewJob_JobIdMustNotBeSet, // ApplicationConstants.RESPONSE_JOB_ID_MUST_NOT_BE_SET 22 39 AddNewJob_JobNull, // ApplicationConstants.RESPONSE_JOB_JOB_NULL … … 30 47 AbortJob_JobIsNotBeeingCalculated, // ApplicationConstants.RESPONSE_JOB_IS_NOT_BEEING_CALCULATED 31 48 32 GetCalendar_Resource NotFound, // ApplicationConstants.RESPONSE_CLIENT_RESOURCE_NOT_FOUND49 GetCalendar_ResourceDoesNotExist, // ApplicationConstants.RESPONSE_CLIENT_RESOURCE_NOT_FOUND 33 50 GetCalendar_NoCalendarFound, // ApplicationConstants.RESPONSE_UPTIMECALENDAR_NO_CALENDAR_FOUND 34 51 35 SetCalendarStatus_Resource NotFound, // ApplicationConstants.RESPONSE_CLIENT_RESOURCE_NOT_FOUND52 SetCalendarStatus_ResourceDoesNotExist, // ApplicationConstants.RESPONSE_CLIENT_RESOURCE_NOT_FOUND 36 53 37 54 ProcessHeartBeat_UserNotLoggedIn, // ApplicationConstants.RESPONSE_COMMUNICATOR_USER_NOT_LOGGED_IN … … 60 77 DeleteResourceFromGroup_SlaveGroupDoesNotExist, // ApplicationConstants.RESPONSE_CLIENT_CLIENTGROUP_DOESNT_EXIST 61 78 62 GetAllGroupsOfResource_Resource NotFound, // ApplicationConstants.RESPONSE_CLIENT_RESOURCE_NOT_FOUND79 GetAllGroupsOfResource_ResourceDoesNotExist, // ApplicationConstants.RESPONSE_CLIENT_RESOURCE_NOT_FOUND 63 80 64 81 DeleteSlaveGroup_SlaveGroupDoesNotExist, // ApplicationConstants.RESPONSE_CLIENT_CLIENTGROUP_DOESNT_EXIST 65 82 83 GetLastSerializedResult_JobDoesNotExist, 84 DeleteHiveExperiment_Failed, 85 DeleteChildJobs_Failed, 66 86 } 67 87 } -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/StreamedObject.cs
r4107 r4423 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 using System; 2 22 using System.Collections.Generic; 3 23 using System.Linq; -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/WcfServicePool.cs
r4368 r4423 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 using System; 2 22 using System.ServiceModel; 3 23 using HeuristicLab.Common; 24 using HeuristicLab.Tracing; 4 25 5 26 namespace HeuristicLab.Hive.Contracts { 6 27 public class WcfServicePool<T> { 7 28 private static object locker = new object(); 29 8 30 private string hostAddress; 31 public string HostAddress { 32 get { return hostAddress; } 33 set { 34 if (hostAddress != value) { 35 hostAddress = value; 36 this.factory = null; 37 } 38 } 39 } 40 41 private string endpointName; 42 9 43 private string username; 44 public string Username { 45 get { return username; } 46 set { 47 if(username != value) { 48 username = value; 49 this.factory = null; 50 } 51 } 52 } 53 10 54 private string password; 11 private string endpointName; 55 public string Password { 56 set { 57 if (password != value) { 58 password = value; 59 this.factory = null; 60 } 61 } 62 } 63 12 64 private ChannelFactory<T> factory = null; 13 65 private Disposable<T> disposableService = null; … … 41 93 factory.Credentials.UserName.Password = password; 42 94 } 43 95 44 96 return factory.CreateChannel(); 45 97 } … … 48 100 lock (locker) { 49 101 requestCount++; 102 Logger.Debug("Request for ServiceProxy (count: " + requestCount + ")"); 103 if (disposableService != null) { 104 if (GetServiceState() == CommunicationState.Faulted) { 105 DisposeService(); 106 } 107 } 50 108 if (disposableService == null) { 51 disposableService = new Disposable<T>(CreateFacade( endpointName));52 disposableService.OnDisposing += new EventHandler(disposableService_OnDisposing);53 } 109 disposableService = new Disposable<T>(CreateFacade(this.endpointName)); 110 RegisterServiceEvents(); 111 } 54 112 return disposableService; 55 113 } 114 } 115 116 private void RegisterServiceEvents() { 117 disposableService.OnDisposing += new EventHandler(disposableService_OnDisposing); 118 ((ICommunicationObject)disposableService.Obj).Faulted += new EventHandler(WcfServicePool_Faulted); 119 } 120 121 private void DeregisterServiceEvents() { 122 disposableService.OnDisposing -= new EventHandler(disposableService_OnDisposing); 123 ((ICommunicationObject)disposableService.Obj).Faulted -= new EventHandler(WcfServicePool_Faulted); 124 } 125 126 private CommunicationState GetServiceState() { 127 return ((ICommunicationObject)disposableService.Obj).State; 128 } 129 130 void WcfServicePool_Faulted(object sender, EventArgs e) { 131 OnExceptionOccured(new CommunicationException(e.ToString())); 56 132 } 57 133 … … 63 139 lock (locker) { 64 140 requestCount--; 141 Logger.Debug("Disposing ServiceProxy (count: " + requestCount + ")"); 65 142 if (requestCount == 0) { 66 WcfSettings.DisposeWcfClient((ICommunicationObject)disposableService.Obj); 67 disposableService = null; 143 try { 144 DeregisterServiceEvents(); 145 WcfSettings.DisposeWcfClient((ICommunicationObject)disposableService.Obj); 146 } 147 catch (Exception e) { 148 OnExceptionOccured(e); 149 } 150 finally { 151 disposableService = null; 152 } 68 153 } else if (requestCount < 0) { 69 154 throw new WcfServicePoolException("requestCount cannot be less than 0."); -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/WcfServicePoolException.cs
r4368 r4423 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 using System; 2 22 3 23 namespace HeuristicLab.Hive.Contracts { -
branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/WcfSettings.cs
r4368 r4423 1 //#define USE_MSG_BINDING 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 //#define USE_MSG_BINDING 2 22 using System; 3 23 using System.Collections.Generic;
Note: See TracChangeset
for help on using the changeset viewer.