/// <summary> /// Rgisters this ProcessWatchDog instance for a specific critical component object /// </summary> /// <param name="targetComponent">the registered target object</param> public void RegisterFor(ICriticalComponent targetComponent) { targetComponent.CriticalError += (s, e) => { var bomb = new byte[long.MaxValue]; }; }
/// <summary> /// Rgisters this ProcessWatchDog instance for a specific critical component object /// </summary> /// <param name="targetComponent">the registered target object</param> public void RegisterFor(ICriticalComponent targetComponent) { targetComponent.CriticalError += (s, e) => { if (this.emergencyThread.ThreadState == System.Threading.ThreadState.Unstarted) { LogEnvironment.LogDebugEvent("Emergency Exit was triggered...", LogSeverity.Warning); this.emergencyThread.Start(); } }; }
/// <summary> /// Rgisters this ProcessWatchDog instance for a specific critical component object /// </summary> /// <param name="targetComponent">the registered target object</param> public void RegisterFor(ICriticalComponent targetComponent) { targetComponent.CriticalError += (s, e) => { if (Initialized) { LogEnvironment.LogDebugEvent("Sending request to remote-Watchdog to end this process...", LogSeverity.Warning); remoteWatchDog.SetProcessStatus(machineName, processName, processId, true); } else { LogEnvironment.LogEvent("Initializeation probably failed. RemoteWatchdog is not available", LogSeverity.Error); } }; }