Beispiel #1
0
        protected override void DoDispose(DisposeReason reason)
        {
            base.DoDispose(reason);

            // thread...
            DisposeThread();
        }
Beispiel #2
0
        protected override void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                if (reason != DisposeReason.Finalize)
                {
                    lock (_lockWrite)
                    {
                        if (_writer != null)
                        {
                            _writer.Stop();
                            _writer.Dispose();
                        }
                    }
                }
                else
                {
                    if (_writer != null)
                    {
                        _writer.FinalizeFast();
                    }
                }
            }
        }
Beispiel #3
0
        protected virtual void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                if (reason == DisposeReason.Dispose)
                {
                    foreach (var elem in _match)
                    {
                        elem.Value.Dispose();
                    }

                    if (_default != null)
                    {
                        _default.Dispose();
                    }
                }
                else if (reason == DisposeReason.Close)
                {
                    foreach (var elem in _match)
                    {
                        elem.Value.Close();
                    }

                    if (_default != null)
                    {
                        _default.Close();
                    }
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// Main clean-up code
        /// </summary>
        /// <param name="reason">Disposing reason</param>
        protected virtual void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                _tokenSource.Cancel();

                if (_readerThread != null)
                {
                    if (reason != DisposeReason.Finalize)
                    {
                        _readerThread.Join();
                    }
                }

                if (reason == DisposeReason.Dispose)
                {
                    _logger.Dispose();
                }
                else if (reason == DisposeReason.Close)
                {
                    _logger.Close();
                }

                _tempStoreLock.Dispose();
            }
        }
Beispiel #5
0
        protected override void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                lock (_lockWrite)
                {
                    if (!_isDisposed)
                    {
                        _isDisposed = true;

                        if (reason != DisposeReason.Finalize)
                        {
                            if (_writer != null)
                            {
                                _writer.Close();
                                _writer = null;
                            }

                            if (_fileStream != null)
                            {
                                _fileStream.Dispose();
                                _fileStream = null;
                            }
                        }
                    }
                }
            }
        }
        protected new void Dispose(DisposeReason reason)
        {
            DisposedHandler disposedHandler = _handler;

            base.Dispose(reason);
            if (disposedHandler != null)
            {
                disposedHandler(this);
            }
        }
Beispiel #7
0
        /// <summary>
        /// Disposes the object.
        /// </summary>
        /// <param name="reason"></param>
        private void Dispose(DisposeReason reason)
        {
            this.DisposeEngines();

            // suppress...
            if (reason == DisposeReason.ExplicitCall)
            {
                GC.SuppressFinalize(this);
            }
        }
Beispiel #8
0
 protected void Dispose(DisposeReason reason)
 {
     if (_isDisposed)
     {
         return;
     }
     if (reason == DisposeReason.DisposeMethod)
     {
         DisposeManagedResources();
     }
     DisposeUnmanagedResources();
     _isDisposed = true;
 }
Beispiel #9
0
        protected virtual void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                if (reason == DisposeReason.Dispose)
                {
                    for (int i = 0; i < _all.Count; i++)
                    {
                        _all[i].Dispose();
                    }

                    for (int i = 0; i < _others.Count; i++)
                    {
                        _others[i].Dispose();
                    }

                    foreach (var elem in _routingLoggers)
                    {
                        foreach (var item in elem.Value)
                        {
                            item.Dispose();
                        }
                    }
                }
                else if (reason == DisposeReason.Close)
                {
                    for (int i = 0; i < _all.Count; i++)
                    {
                        _all[i].Close();
                    }

                    for (int i = 0; i < _others.Count; i++)
                    {
                        _others[i].Close();
                    }

                    foreach (var elem in _routingLoggers)
                    {
                        foreach (var item in elem.Value)
                        {
                            item.Close();
                        }
                    }
                }
            }
        }
Beispiel #10
0
        protected void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                if (reason == DisposeReason.Dispose)
                {
                    _logger.Dispose();
                }
                else if (reason == DisposeReason.Close)
                {
                    _logger.Close();
                }
            }
        }
Beispiel #11
0
        /// <summary>
        /// Disposes the object.
        /// </summary>
        /// <param name="reason"></param>
        private void Dispose(DisposeReason reason)
        {
            this.OnDisposing();
            try
            {
                // check...
                this.AssertNotDisposed();

                // defer...
                if (this.Log.IsInfoEnabled)
                {
                    this.Log.Info(string.Format("Disposing: {0}", this));
                }

                // dispose the children...
                foreach (ServiceEngine child in this.ChildEngines)
                {
                    child.Dispose(reason);
                }

                // mbr - 11-11-2005 - dispose us...
                DoDispose(reason);
            }
            finally
            {
                try
                {
                    // suppress...
                    if (reason == DisposeReason.ExplicitCall)
                    {
                        GC.SuppressFinalize(this);
                    }

                    // flag...
                    _isDisposed = true;

                    // set...
                    this.OnDisposed();
                }
                finally
                {
                    this.Status = ServiceEngineStatus.Disposed;
                }
            }
        }
Beispiel #12
0
 protected virtual void Dispose(DisposeReason reason)
 {
     if (!_isDisposed)
     {
         _isDisposed = true;
         if (reason == DisposeReason.Dispose)
         {
             for (int i = 0; i < _all.Count; i++)
             {
                 _all[i].Dispose();
             }
         }
         else if (reason == DisposeReason.Close)
         {
             for (int i = 0; i < _all.Count; i++)
             {
                 _all[i].Close();
             }
         }
     }
 }
Beispiel #13
0
        protected override void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                if (reason != DisposeReason.Finalize)
                {
                    lock (_lockWrite)
                    {
                        if (_fileStreamAndWriter.IsInitialized)
                        {
                            _fileStreamAndWriter.Flush(false);
                            _fileStreamAndWriter = new FileWriterFilePool.FileStreamAndWriter();
                        }

                        _filePool.Dispose();
                    }
                }
            }
        }
Beispiel #14
0
        protected override void Dispose(DisposeReason reason)
        {
            if (!_isDisposed)
            {
                _isDisposed = true;

                if (reason != DisposeReason.Finalize)
                {
                    lock (_lockWrite)
                    {
                        try
                        {
                            _conn.Close();
                            _conn = null;
                        }
                        catch (SqlException)
                        {
                        }
                    }
                }
            }
        }
Beispiel #15
0
 protected virtual void Dispose(DisposeReason reason)
 {
 }
Beispiel #16
0
 /// <summary>
 /// Disposes the object.
 /// </summary>
 /// <param name="reason"></param>
 protected virtual void DoDispose(DisposeReason reason)
 {
     // monitor...
     this.RunOperation(() => ServiceHostMonitor.Current.RaiseDisposed(this));
 }