Changeset 5621 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveWindowsService
- Timestamp:
- 03/07/11 16:15:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.SlaveWindowsService/SlaveWindowsService.cs
r5599 r5621 19 19 */ 20 20 #endregion 21 using System; 21 22 using System.ServiceProcess; 22 23 using System.Threading; 23 using HeuristicLab.Clients.Hive.SlaveCore;24 24 25 25 namespace HeuristicLab.Clients.Hive.SlaveCore.SlaveWindowsService { … … 30 30 public SlaveWindowsService() { 31 31 InitializeComponent(); 32 if (!System.Diagnostics.EventLog.SourceExists("HeuristicLab Hive Slave"))33 System.Diagnostics.EventLog.CreateEventSource("HeuristicLab Hive Slave",34 "HeuristicLab Hive Slave");35 32 36 eventLog.Source = "HeuristicLab Hive Slave"; 37 eventLog.Log = "HeuristicLab Hive Slave"; 33 try { 34 if (!System.Diagnostics.EventLog.SourceExists("HLHive")) { 35 System.Diagnostics.EventLog.CreateEventSource("HLHive", "Slave"); 36 } 37 eventLog.Source = "HLHive"; 38 eventLog.Log = "Slave"; 39 } 40 catch (Exception) { } 38 41 } 39 42 … … 42 45 coreThread = new Thread(core.Start); 43 46 coreThread.Start(); 44 eventLog.WriteEntry("HeuristicLab Hive Slave started!"); 47 48 try { 49 eventLog.WriteEntry("HeuristicLab Hive Slave started!"); 50 } 51 catch (Exception) { } 45 52 } 46 53 47 54 protected override void OnStop() { 48 eventLog.WriteEntry("Shutting down HeuristicLab Hive Slave..."); 55 try { 56 eventLog.WriteEntry("Shutting down HeuristicLab Hive Slave..."); 57 } 58 catch (Exception) { } 59 49 60 core.Shutdown(); 50 eventLog.WriteEntry("HeuristicLab Hive Slave stopped!"); 61 62 try { 63 eventLog.WriteEntry("HeuristicLab Hive Slave stopped!"); 64 } 65 catch (Exception) { } 51 66 } 52 67 }
Note: See TracChangeset
for help on using the changeset viewer.