public void Call_Die() { _Status = PluginStatus.Stopped; DoCallback(new PluginEventArgs(PluginEventMessageType.Message, "Calling die, stopping process, sending UNLOAD... from: " + _pluginName)); PluginEventAction actionCommand = new PluginEventAction(); actionCommand.ActionToTake = PluginActionType.Unload; DoCallback(new PluginEventArgs(PluginEventMessageType.Action, null, actionCommand)); // make a generic "reboot / update service" event handler ?! }
public void Call_Die() { _Status = PluginStatus.Stopped; DoCallback(new PluginEventArgs(PluginEventMessageType.Message, "Calling die, stopping process, sending UNLOAD... from: " + _pluginName)); PluginEventAction actionCommand = new PluginEventAction(); actionCommand.ActionToTake = PluginActionType.Unload; DoCallback(new PluginEventArgs(PluginEventMessageType.Action, null, actionCommand)); // telling controller it can no unload me.... }
public void ProcessEnded() { if (_terminateRequestReceived) // plugin has been asked to notify on process so it can be terminated, therefore send "unload" message { if (counter != null) { counter.Stop(); } PluginEventAction actionCommand = new PluginEventAction(); actionCommand.ActionToTake = PluginActionType.Unload; } }
// OnTimer event, process start raised, sleep to simulate doing some work, then process end raised public void OnCounterElapsed(Object sender, EventArgs e) { _Status = PluginStatus.Processing; DoCallback(new PluginEventArgs(PluginEventMessageType.Message, "Counter elapsed from: " + _pluginName)); if (_terminateRequestReceived) { DoCallback(new PluginEventArgs(PluginEventMessageType.Message, "Counter elapsed, terminate received, stopping process... from: " + _pluginName)); } // TEST FOR DIE... DoCallback(new PluginEventArgs(PluginEventMessageType.Message, "*** Sending UPDATE SERVICE WITH INSTALLER COMMAND ***")); PluginEventAction actionCommand = new PluginEventAction(); actionCommand.ActionToTake = PluginActionType.TerminateAndUnloadPlugins; // TEST !!!! ... this should ONLY be used to signal the HOST/CONTROLLER to flag a DIE.... DoCallback(new PluginEventArgs(PluginEventMessageType.Action, null, actionCommand)); DoCallback(new PluginEventArgs(PluginEventMessageType.Message, "*** Sending UPDATE SERVICE WITH INSTALLER COMMAND - COMPLETE ***")); Call_Die(); // end test }