- Timestamp:
- 11/02/11 18:42:44 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
r6910 r6945 71 71 public void Start() { 72 72 abortRequested = false; 73 EventLogManager.ServiceEventLog = ServiceEventLog; 73 74 74 75 try { … … 90 91 catch (Exception ex) { 91 92 if (ServiceEventLog != null) { 92 try { 93 ServiceEventLog.WriteEntry(string.Format("Hive Slave threw exception: {0} with stack trace: {1}", ex.ToString(), ex.StackTrace), EventLogEntryType.Error); 94 } 95 catch (Exception) { } 93 EventLogManager.LogException(ex); 96 94 } else { 97 95 //try to log with clientCom. if this works the user sees at least a message, -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/HeuristicLab.Clients.Hive.Slave-3.3.csproj
r6896 r6945 118 118 <Compile Include="ExecutorQueue.cs" /> 119 119 <Compile Include="IPluginProvider.cs" /> 120 <Compile Include="Manager\EventLogManager.cs" /> 120 121 <Compile Include="Manager\TaskManager.cs" /> 121 122 <Compile Include="Exceptions\OutOfCoresException.cs" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveClientCom.cs
r6456 r6945 57 57 } 58 58 catch { 59 pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(dummy, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/HeuristicLabSlaveCom")); 59 EventLogManager.LogMessage("Couldn't create pipe for SlaveClientCom with config!"); 60 61 try { 62 pipeFactory = new DuplexChannelFactory<ISlaveCommunication>(dummy, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/HeuristicLabSlaveCom")); 63 } 64 catch { 65 EventLogManager.LogMessage("Couldn't create pipe for SlaveClientCom with fixed addresse!"); 66 return; 67 } 60 68 } 69 pipeFactory.Faulted += new System.EventHandler(pipeFactory_Faulted); 61 70 62 71 ISlaveCommunication pipeProxy = pipeFactory.CreateChannel(); … … 64 73 } 65 74 75 void pipeFactory_Faulted(object sender, System.EventArgs e) { 76 EventLogManager.LogMessage("SlaveClientCom just faulted. Trying to repair it..."); 77 78 try { 79 pipeFactory.Faulted -= new System.EventHandler(pipeFactory_Faulted); 80 SetupClientCom(); 81 } 82 catch { } 83 } 84 66 85 public static void Close() { 67 if (pipeFactory.State != CommunicationState.Closed )86 if (pipeFactory.State != CommunicationState.Closed && pipeFactory.State != CommunicationState.Faulted) 68 87 pipeFactory.Close(); 69 88 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveCommunicationService.cs
r6371 r6945 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.ServiceModel; … … 54 55 55 56 public void LogMessage(string message) { 56 subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) { 57 if (((ICommunicationObject)callback).State == CommunicationState.Opened) { 58 callback.OnMessageLogged(message); 59 } else { 60 subscribers.Remove(callback); 61 } 62 }); 57 try { 58 subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) { 59 if (((ICommunicationObject)callback).State == CommunicationState.Opened) { 60 callback.OnMessageLogged(message); 61 } else { 62 subscribers.Remove(callback); 63 } 64 }); 65 } 66 catch (Exception ex) { 67 EventLogManager.LogException(ex); 68 } 63 69 } 64 70 65 71 public void StatusChanged(StatusCommons status) { 66 subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) { 67 if (((ICommunicationObject)callback).State == CommunicationState.Opened) { 68 callback.OnStatusChanged(status); 69 } else { 70 subscribers.Remove(callback); 71 } 72 }); 72 try { 73 subscribers.ForEach(delegate(ISlaveCommunicationCallbacks callback) { 74 if (((ICommunicationObject)callback).State == CommunicationState.Opened) { 75 callback.OnStatusChanged(status); 76 } else { 77 subscribers.Remove(callback); 78 } 79 }); 80 } 81 catch (Exception ex) { 82 EventLogManager.LogException(ex); 83 } 73 84 } 74 85 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/SlaveTask.cs
r6725 r6945 51 51 52 52 public TimeSpan ExecutionTime { 53 get { return executor != null ? executor.ExecutionTime : TimeSpan.Zero; } 53 get { 54 try { 55 return executor != null ? executor.ExecutionTime : TimeSpan.Zero; 56 } 57 catch (Exception ex) { 58 EventLogManager.LogException(ex); 59 return TimeSpan.Zero; 60 } 61 } 54 62 } 55 63 … … 122 130 123 131 if (executor != null) { 124 executor.Dispose(); 132 try { 133 executor.Dispose(); 134 } 135 catch (Exception ex) { 136 EventLogManager.LogException(ex); 137 } 125 138 } 126 139 … … 155 168 156 169 public TaskData GetTaskData() { 157 return executor.GetTaskData(); 170 TaskData data = null; 171 try { 172 data = executor.GetTaskData(); 173 } 174 catch (Exception ex) { 175 EventLogManager.LogException(ex); 176 } 177 return data; 158 178 } 159 179
Note: See TracChangeset
for help on using the changeset viewer.