Package org.apache.qpid.proton.engine

Examples of org.apache.qpid.proton.engine.Delivery


                while (link != null) {
                    onLinkOpen(link);
                    link = protonConnection.linkHead(UNINITIALIZED_SET, INITIALIZED_SET);
                }

                Delivery delivery = protonConnection.getWorkHead();
                while (delivery != null) {
                    AmqpDeliveryListener listener = (AmqpDeliveryListener) delivery.getLink().getContext();
                    if (listener != null) {
                        listener.onDelivery(delivery);
                    }
                    delivery = delivery.getWorkNext();
                }

                link = protonConnection.linkHead(ACTIVE_STATE, CLOSED_STATE);
                while (link != null) {
                    ((AmqpDeliveryListener) link.getContext()).onClose();
View Full Code Here


                while (link != null) {
                    onLinkOpen(link);
                    link = protonConnection.linkHead(UNINITIALIZED_SET, INITIALIZED_SET);
                }

                Delivery delivery = protonConnection.getWorkHead();
                while (delivery != null) {
                    AmqpDeliveryListener listener = (AmqpDeliveryListener) delivery.getLink().getContext();
                    if (listener != null) {
                        listener.onDelivery(delivery);
                    }
                    delivery = delivery.getWorkNext();
                }

                link = protonConnection.linkHead(ACTIVE_STATE, CLOSED_STATE);
                while (link != null) {
                    ((AmqpDeliveryListener) link.getContext()).onClose();
View Full Code Here

            Sender sender = getLink(address.getHost(), port, new SenderFinder(cleanPath(address.getPath())));

            adjustReplyTo(m);

            byte[] tag = String.valueOf(_nextTag++).getBytes();
            Delivery delivery = sender.delivery(tag);
            int encoded;
            while (true)
            {
                try
                {
View Full Code Here

    {
        for (Connector c : _driver.connectors())
        {
            Connection connection = c.getConnection();
            _logger.log(Level.FINE, "Attempting to get message from " + connection);
            Delivery delivery = connection.getWorkHead();
            while (delivery != null)
            {
                if (delivery.isReadable() && !delivery.isPartial())
                {
                    _logger.log(Level.FINE, "Readable delivery found: " + delivery);
                    int size = read((Receiver) delivery.getLink());
                    Message message = _messageFactory.createMessage();
                    message.decode(_buffer, 0, size);
                    _incoming.add(delivery);
                    _distributed--;
                    delivery.getLink().advance();
                    return message;
                }
                else
                {
                    _logger.log(Level.FINE, "Delivery not readable: " + delivery);
                    delivery = delivery.getWorkNext();
                }
            }
        }
        return null;
    }
View Full Code Here

            if (connection.getLocalState() == EndpointState.UNINITIALIZED)
            {
                connection.open();
            }

            Delivery delivery = connection.getWorkHead();
            while (delivery != null)
            {
                if (delivery.getLink() instanceof Sender && delivery.isUpdated())
                {
                    delivery.disposition(delivery.getRemoteState());
                }
                //TODO: delivery.clear(); What's the equivalent in java?
                delivery = delivery.getWorkNext();
            }
            _outgoing.slide();

            for (Session session : new Sessions(connection, UNINIT, ANY))
            {
View Full Code Here

        {
            if (unsettled != null)
            {
                while (unsettled.hasNext())
                {
                    Delivery d = unsettled.next();
                    if (d == null)
                    {
                        break;
                    }
                    if (d.getRemoteState() != null || d.remotelySettled())
                    {
                        d.settle();
                    }
                    else if (d.getLink().getSession().getConnection().getRemoteState() == EndpointState.CLOSED)
                    {
                        continue;
                    }
                    else
                    {
View Full Code Here

        {
            //do we have at least one message?
            for (Connector c : _driver.connectors())
            {
                Connection connection = c.getConnection();
                Delivery delivery = connection.getWorkHead();
                while (delivery != null)
                {
                    if (delivery.isReadable() && !delivery.isPartial())
                    {
                        return true;
                    }
                    else
                    {
                        delivery = delivery.getWorkNext();
                    }
                }
            }
            return false;
        }
View Full Code Here

        slide();
    }

    Status getStatus(Tracker tracker)
    {
        Delivery delivery = getDelivery(tracker);
        if (delivery != null)
        {
            DeliveryState state = delivery.getRemoteState();
            if (state != null)
            {
                return getStatus(state);
            }
            else if (delivery.remotelySettled() || delivery.isSettled())
            {
                return getStatus(delivery.getLocalState());
            }
            else
            {
                return Status.PENDING;
            }
View Full Code Here

            {
                if (_deliveries.isEmpty())
                {
                    throw new RuntimeException("Inconsistent state, empty delivery queue but lwm=" + _lwm + " and hwm=" + _hwm);
                }
                Delivery d = _deliveries.get(0);
                if (d.getLocalState() == null)
                {
                    d.disposition(ACCEPTED);
                }

                d.settle();
                _deliveries.remove(0);
                _lwm++;
            }
        }
    }
View Full Code Here

        if (seq < _lwm || seq > _hwm) return;
        int last = seq - _lwm;
        int start = (flags & Messenger.CUMULATIVE) != 0 ? 0 : last;
        for (int i = start; i <= last && i < _deliveries.size(); ++i)
        {
            Delivery d = _deliveries.get(i);
            if (d != null && !d.isSettled())
            {
                operation.apply(d);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.proton.engine.Delivery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.