Inheritance: BaseCommand
Beispiel #1
0
 internal void Dispose()
 {
     if(!closed)
     {
         this.closed = true;
         try
         {
             RemoveInfo removeIt = new RemoveInfo();
             removeIt.ObjectId = this.info.ConsumerId;
             this.connection.Oneway(removeIt);
         }
         catch(Exception e)
         {
             Tracer.Debug("Failoed to send remove for AdvisoryConsumer: " + e.Message);
         }
         this.connection.removeDispatcher(this.info.ConsumerId);
     }
 }
Beispiel #2
0
 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.
     }
 }
Beispiel #3
0
		internal void DoClose()
		{
	        Shutdown();
			RemoveInfo removeCommand = new RemoveInfo();
			removeCommand.ObjectId = this.ConsumerId;
	        if (Tracer.IsDebugEnabled) 
			{
				Tracer.DebugFormat("Remove of Consumer[{0}] sent last delivered Id[{1}].", 
				                   this.ConsumerId, this.lastDeliveredSequenceId);
	        }
	        removeCommand.LastDeliveredSequenceId = lastDeliveredSequenceId;
	        this.session.Connection.Oneway(removeCommand);
		}
Beispiel #4
0
        internal void DoClose()
        {
			Shutdown();
            RemoveInfo info = new RemoveInfo();
            info.ObjectId = this.info.SessionId;
            info.LastDeliveredSequenceId = this.lastDeliveredSequenceId;
            this.connection.Oneway(info);
		}
Beispiel #5
0
        public void Close()
        {
            lock(closedLock)
            {
                if(closed)
                {
                    return;
                }

                Shutdown();
                RemoveInfo removeInfo = new RemoveInfo();
                removeInfo.ObjectId = this.info.ProducerId;
                this.session.Connection.Oneway(removeInfo);
                if(Tracer.IsDebugEnabled)
                {
                    Tracer.DebugFormat("Remove of Producer[{0}] sent.", this.ProducerId);
                }
            }
        }