Example #1
0
        /// <summary>
        /// Stops the service.
        /// </summary>
        /// <remarks>
        /// OnStop() hook methods (from this and/or derived classes) are
        /// called upon stopping the service.
        /// </remarks>
        /// <param name="shutdown">Indicates that the system is being shut down.
        /// </param>
        internal void Stop(bool shutdown)
        {
            // create stop args
            OnStopServiceArgs args = new OnStopServiceArgs()
            {
                Shutdown = shutdown
            };

            // stop service
            this.Logger.Event.LogInfo("The service is being stopped...");

            this.OnStop(args);

            this.Logger.Event.LogInfo("The service has been stopped successfully!");
        }
 protected override void OnStop(OnStopServiceArgs args)
 {
     this.consoleServer.Stop();
     this.watcher.Stop();
     this.reporter.Stop();
 }
Example #3
0
 protected override void OnStop(OnStopServiceArgs args)
 {
     thread.Abort();
 }
Example #4
0
 protected override void OnStop(OnStopServiceArgs args)
 {
     gateway.Stop();
     processor.Stop();
     broker.Stop();
 }
Example #5
0
 /// <summary>
 /// A hook method which is called before the service is stopped
 /// (manually or due to a system shutdown). It is intended to be
 /// implemented in a derived class.
 /// </summary>
 /// <remarks>
 /// In derived classes it is not necessary to call base.OnSop().
 /// </remarks>
 /// <param name="args">Arguments for stopping the service.</param>
 protected virtual void OnStop(OnStopServiceArgs args)
 {
 }
Example #6
0
 protected override void OnStop(OnStopServiceArgs args)
 {
     this.timer.Abort();
     this.mreStopPending.WaitOne();
 }