public void Dispose()
 {
     if (_bus != null)
     {
         _bus.Dispose();
         _bus = null;
     }
 }
Exemple #2
0
        public bool Stop()
        {
            if (bus != null)
            {
                bus.Dispose();
            }

            return(true);
        }
Exemple #3
0
        void OnCriticalError(string errorMessage, Exception exception)
        {
            // If you want the process to be active, dispose the bus.
            // Note that when the bus is disposed sending messages will throw with an ObjectDisposedException.
            bus.Dispose();

            // If you want to kill the process, raise a fail fast error as shown below.
            //string failMessage = string.Format("Critical error shutting down:'{0}'.", errorMessage);
            //Environment.FailFast(failMessage, exception);
        }
        void OnCriticalError(string errorMessage, Exception exception)
        {
            // To leave the process active, dispose the bus.
            // When the bus is disposed sending messages will throw an ObjectDisposedException.
            bus.Dispose();

            // To kill the process, raise a fail fast error as shown below.
            // var failMessage = $"Critical error shutting down:'{errorMessage}'.";
            // Environment.FailFast(failMessage, exception);
        }
        void OnCriticalError()
        {
            //Write log entry in version 3 since this is not done by default.
            Logger.Fatal("CRITICAL Error");

            // If you want the process to be active, dispose the bus.
            // Note that when the bus is disposed sending messages will throw with an ObjectDisposedException.
            bus.Dispose();

            // If you want to kill the process, raise a fail fast error as shown below.
            //string failMessage = string.Format("Critical error shutting down:'{0}'.", errorMessage);
            //Environment.FailFast(failMessage, exception);
        }
Exemple #6
0
 void OnCriticalError(string errorMessage, Exception exception)
 {
     try
     {
         // To leave the process active, dispose the bus.
         // When the bus is disposed, the attempt to send message will cause an ObjectDisposedException.
         bus.Dispose();
         // Perform custom actions here, e.g.
         // NLog.LogManager.Shutdown();
     }
     finally
     {
         var failMessage = $"Critical error shutting down:'{errorMessage}'.";
         Environment.FailFast(failMessage, exception);
     }
 }
Exemple #7
0
        private void Dispose(bool destruct)
        {
            if (!_disposed)
            {
                if (_bus != null)
                {
                    _bus.Dispose();
                    _bus = null;
                }

                if (_factory != null)
                {
                    _factory.Dispose();
                    _factory = null;
                }

                _disposed = true;
            }
        }
Exemple #8
0
 protected void Application_End()
 {
     startableBus.Dispose();
 }
 public void Stop()
 {
     bus.Dispose();
 }
 public void Dispose()
 {
     startableBus.Dispose();
 }