Apache.NMS.ActiveMQ.Connection.DisposeOf C# (CSharp) Метод

DisposeOf() приватный Метод

private DisposeOf ( DataStructure objectId ) : void
objectId DataStructure
Результат void
        private void DisposeOf(DataStructure objectId)
        {
            try
            {
                RemoveInfo command = new RemoveInfo();
                command.ObjectId = objectId;
                if(asyncClose)
                {
                    Tracer.Info("Asynchronously disposing of Connection.");
                    if(connected.Value)
                    {
                        transport.Oneway(command);
                    }
                    Tracer.Info("Oneway command sent to broker.");
                }
                else
                {
                    // Ensure that the object is disposed to avoid potential race-conditions
                    // of trying to re-create the same object in the broker faster than
                    // the broker can dispose of the object.  Allow up to 5 seconds to process.
                    Tracer.Info("Synchronously disposing of Connection.");
                    SyncRequest(command, TimeSpan.FromSeconds(5));
                    Tracer.Info("Synchronously closed Connection.");
                }
            }
            catch // (BrokerException)
            {
                // Ignore exceptions while shutting down.
            }
        }

Usage Example

Пример #1
0
 public void DisposeOf(ProducerId objectId)
 {
     Connection.DisposeOf(objectId);
     if (!this.closing)
     {
         producers.Remove(objectId);
     }
 }
All Usage Examples Of Apache.NMS.ActiveMQ.Connection::DisposeOf