Beispiel #1
0
        protected override void Dispose(bool disposing)
        {
            _Monitor.Stop();
            _Monitor.Dispose();

            _Manager.Dispose();

            base.Dispose(disposing);
        }
Beispiel #2
0
        protected override void Dispose(bool disposing)
        {
            _Logger.Information("Deinitializing resources");

            _Monitor.Stop();
            _Monitor.Dispose();

            _Manager.Dispose();

            base.Dispose(disposing);
        }
Beispiel #3
0
        public void ShouldDisposeCleanly()
        {
            IElasticClient elasticClient = A.Fake <IElasticClient>();
            TestScheduler  testScheduler = new TestScheduler();

            IMonitorFactory <TestMessage> factory = new ElasticSearchMonitorFactory <TestMessage>("indexName", new List <Type>(), "instanceName", TimeSpan.FromSeconds(1), testScheduler, elasticClient);

            IMonitor <TestMessage> monitor = factory.Create("SomeName");

            monitor.Dispose();
        }
Beispiel #4
0
 internal void Replace(IMonitor monitor)
 {
     if (monitor?.IsReachable is true)
     {
         lock (_lock)
         {
             this._monitor.Dispose();
             this._monitor = monitor;
         }
     }
     else
     {
         monitor?.Dispose();
     }
 }
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         if (disposing)
         {
             // Dispose managed resources.
             if (monitor != null)
             {
                 monitor.Dispose();
                 MessageAnalyzerMonitor.instance = null;
             }
         }
         disposed = true;
     }
 }
Beispiel #6
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (disposing)
            {
                _monitor.Dispose();
            }

            _isDisposed = true;

            base.Dispose(disposing);
        }
Beispiel #7
0
        public bool FreeMonitor(string name)
        {
            lock (mMonitors.SyncRoot)
            {
                IMonitor monitor = mMonitors[name] as IMonitor;
                if (monitor != null && monitor.Verify(ACOpts.Exec_Cleanup))
                {
                    mMonitors.Remove(name);

                    monitor.Dispose();

                    return(true);
                }
            }
            return(false);
        }
Beispiel #8
0
 public void Dispose()
 {
     _endpointClient.Dispose();
     _monitor.Dispose();
 }
Beispiel #9
0
 public void Dispose()
 {
     _monitoredCashRegister.Dispose();
 }
Beispiel #10
0
 protected override void Cleanup()
 {
     _sut?.Dispose();
     _monitorEvents.Dispose();
 }