Apache.NMS.ActiveMQ.QueueBrowser.Close C# (CSharp) Method

Close() public method

public Close ( ) : void
return void
        public void Close()
        {
            lock(myLock)
            {
                if(this.closed)
                {
                    return;
                }

                try
                {
                    DestroyConsumer();
                }
                catch(Exception ex)
                {
                    Tracer.ErrorFormat("Error during QueueBrowser close: {0}", ex);
                }
                finally
                {
                    this.closed = true;
                }
            }
        }

Usage Example

Example #1
0
        public IQueueBrowser CreateBrowser(IQueue queue, string selector)
        {
            if (queue == null)
            {
                throw new InvalidDestinationException("Cannot create a Consumer with a Null destination");
            }

            ActiveMQDestination dest    = ActiveMQDestination.Transform(queue);
            QueueBrowser        browser = null;

            try
            {
                browser = new QueueBrowser(this, GetNextConsumerId(), dest, selector, this.DispatchAsync);
            }
            catch (Exception)
            {
                if (browser != null)
                {
                    browser.Close();
                }

                throw;
            }

            return(browser);
        }
All Usage Examples Of Apache.NMS.ActiveMQ.QueueBrowser::Close