Changeset 6258
- Timestamp:
- 05/23/11 23:06:53 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
r6257 r6258 37 37 /// </summary> 38 38 public class Core : MarshalByRefObject { 39 public static ILog Log { get; set; } 40 public static bool AbortRequested { get; set; } 41 42 private static HeartbeatManager heartbeatManager; 43 public static HeartbeatManager HeartbeatManager { 44 get { return heartbeatManager; } 45 } 46 39 47 private ISlaveCommunication clientCom; 40 48 private ServiceHost slaveComm; … … 42 50 private Dictionary<Guid, SlaveJob> slaveJobs = new Dictionary<Guid, SlaveJob>(); 43 51 private WcfService wcfService; 44 private static HeartbeatManager heartbeatManager; 45 46 public static HeartbeatManager HBManager { get { return heartbeatManager; } } 47 public static ILog Log { get; set; } 52 48 53 public EventLog ServiceEventLog { get; set; } 49 public static bool abortRequested { get; set; }50 54 public Dictionary<Guid, SlaveJob> SlaveJobs { get { return slaveJobs; } } 51 55 … … 56 60 /// </summary> 57 61 public void Start() { 58 abortRequested = false;62 AbortRequested = false; 59 63 60 64 try { … … 91 95 } 92 96 finally { 93 De RegisterServiceEvents();97 DeregisterServiceEvents(); 94 98 waitShutdownSem.Release(); 95 99 } … … 106 110 private void DispatchMessageQueue() { 107 111 MessageQueue queue = MessageQueue.GetInstance(); 108 while (! abortRequested) {112 while (!AbortRequested) { 109 113 MessageContainer container = queue.GetMessage(); 110 114 DetermineAction(container); 111 if (! abortRequested) {115 if (!AbortRequested) { 112 116 clientCom.StatusChanged(ConfigManager.Instance.GetStatusForClientConsole()); 113 117 } … … 120 124 } 121 125 122 private void De RegisterServiceEvents() {126 private void DeregisterServiceEvents() { 123 127 WcfService.Instance.Connected -= WcfService_Connected; 124 128 WcfService.Instance.ExceptionOccured -= WcfService_ExceptionOccured; 125 129 } 126 130 127 void WcfService_ExceptionOccured(object sender, EventArgs<Exception> e) {131 private void WcfService_ExceptionOccured(object sender, EventArgs<Exception> e) { 128 132 clientCom.LogMessage(string.Format("Connection to server interruped with exception: {0}", e.Value.Message)); 129 133 } 130 134 131 void WcfService_Connected(object sender, EventArgs e) {135 private void WcfService_Connected(object sender, EventArgs e) { 132 136 clientCom.LogMessage("Connected successfully to Hive server"); 133 137 } … … 346 350 clientCom.LogMessage("Stopping heartbeat"); 347 351 heartbeatManager.StopHeartBeat(); 348 abortRequested = true;352 AbortRequested = true; 349 353 clientCom.LogMessage("Logging out"); 350 354 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveJob.cs
r6248 r6258 175 175 finally { 176 176 KillAppDomain(); 177 Core.H BManager.AwakeHeartBeatThread();177 Core.HeartbeatManager.AwakeHeartBeatThread(); 178 178 } 179 179 } … … 243 243 } 244 244 } 245 Core.H BManager.AwakeHeartBeatThread();245 Core.HeartbeatManager.AwakeHeartBeatThread(); 246 246 } 247 247
Note: See TracChangeset
for help on using the changeset viewer.