/// <summary> /// This override sends the service stop message. /// </summary> protected override void StopInternal() { mEventsWrapper.OnStopRequested(); LogStatistics().Wait(TimeSpan.FromSeconds(15)); EventStop(() => mCommands.CommandsStop(ServiceStop), "Commands"); EventStop(() => mCommunication.ListenersStop(), "Communication Listeners"); EventStop(() => ServiceStop(mCommands), "Command Container"); EventStop(() => TaskManagerStop(), "Task Manager"); //Stop the sender EventStop(() => mCommunication.SendersStop(), "Communication Senders"); EventStop(() => ServiceStop(mCommunication), "Communication Container"); //Stop the channel controller. EventStop(() => ServiceStop(mResourceMonitor), "Resource Tracker"); EventStop(() => ServiceStop(mDataCollection), "Data Collection"); EventStop(() => ServiceStop(mServiceHandlers), "Service Handler Container"); mEventsWrapper.OnStopCompleted(); }