Dispose() public method

public Dispose ( ) : void
return void
Ejemplo n.º 1
0
                void OnTxnDischarge(Delivery delivery, bool fail)
                {
                    if (!fail)
                    {
                        BrokerMessage message = (BrokerMessage)delivery;
                        if (message.Node != null && message.Node.List != null)
                        {
                            this.queue.Dequeue(message);
                        }

                        this.link.DisposeDelivery(delivery, true, delivery.State);
                        delivery.Dispose();
                    }
                }
Ejemplo n.º 2
0
                void OnDispose(Delivery delivery)
                {
                    if (delivery.Transactional())
                    {
                        Transaction txn = this.queue.broker.txnManager.GetTransaction(((TransactionalState)delivery.State).TxnId);
                        txn.AddOperation(delivery, this.OnTxnDischarge);
                        this.link.DisposeDelivery(delivery, false, delivery.State, false);
                    }
                    else
                    {
                        if (!delivery.Settled)
                        {
                            this.link.DisposeDelivery(delivery, true, delivery.State);
                        }

                        BrokerMessage message = (BrokerMessage)delivery;
                        if (delivery.State.DescriptorCode == Accepted.Code ||
                            delivery.State.DescriptorCode == Rejected.Code ||
                            delivery.State.DescriptorCode == Modified.Code)
                        {
                            if (message.Node != null && message.Node.List != null)
                            {
                                this.queue.Dequeue(message);
                            }

                            delivery.Dispose();
                        }
                        else if (delivery.State.DescriptorCode == Released.Code)
                        {
                            this.queue.Unlock(message);
                        }
                    }
                }