Apache.NMS.ActiveMQ.MessageProducer.Shutdown C# (CSharp) Method

Shutdown() private method

Called from the Parent session to deactivate this Producer, when a parent is closed all children are automatically removed from the broker so this method circumvents the need to send a Remove command to the broker.
private Shutdown ( ) : void
return void
        internal void Shutdown()
        {
            lock(closedLock)
            {
                if(closed)
                {
                    return;
                }

                try
                {
                    session.RemoveProducer(info.ProducerId);
                }
                catch(Exception ex)
                {
                    Tracer.ErrorFormat("Error during producer close: {0}", ex);
                }

                if(this.usage != null)
                {
                    this.usage.Stop();
                }

                closed = true;
            }
        }