Package org.apache.qpid.proton.engine

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


        }

        Delivery delivery = connection.getWorkHead();
        while (delivery != null)
        {
            Link link = delivery.getLink();
            if (delivery.isUpdated())
            {
                if (link instanceof Sender)
                {
                    delivery.disposition(delivery.getRemoteState());
                }
                StoreEntry e = (StoreEntry) delivery.getContext();
                if (e != null) e.updated();
            }

            if (delivery.isReadable())
            {
                pumpIn( link.getSource().getAddress(), (Receiver)link );
            }

            Delivery next = delivery.getWorkNext();
            delivery.clear();
            delivery = next;
        }

        for (Session session : new Sessions(connection, UNINIT, ANY))
        {
            session.open();
            _logger.log(Level.FINE, "Opened session " + session);
        }
        for (Link link : new Links(connection, UNINIT, ANY))
        {
            //TODO: the following is not correct; should only copy those properties that we understand
            link.setSource(link.getRemoteSource());
            link.setTarget(link.getRemoteTarget());
            linkAdded(link);
            link.open();
            _logger.log(Level.FINE, "Opened link " + link);
        }

        distributeCredit();

        for (Link link : new Links(connection, ACTIVE, ACTIVE))
        {
            if (link instanceof Sender)
            {
                pumpOut(link.getTarget().getAddress(), (Sender)link);
            }
        }

        for (Session session : new Sessions(connection, ACTIVE, CLOSED))
        {
            session.close();
        }

        for (Link link : new Links(connection, ANY, CLOSED))
        {
            if (link.getLocalState() == EndpointState.ACTIVE)
            {
                link.close();
            }
            else
            {
                reclaimLink(link);
            }
View Full Code Here


                while (session != null) {
                    onSessionOpen(session);
                    session = protonConnection.sessionHead(UNINITIALIZED_SET, INITIALIZED_SET);
                }

                Link link = protonConnection.linkHead(UNINITIALIZED_SET, INITIALIZED_SET);
                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();
                    link.close();
                    link = link.next(ACTIVE_STATE, CLOSED_STATE);
                }

                link = protonConnection.linkHead(ACTIVE_STATE, ALL_STATES);
                while (link != null) {
                    ((AmqpDeliveryListener) link.getContext()).drainCheck();
                    link = link.next(ACTIVE_STATE, ALL_STATES);
                }

                session = protonConnection.sessionHead(ACTIVE_STATE, CLOSED_STATE);
                while (session != null) {
                    // TODO - close links?
View Full Code Here

                while (session != null) {
                    onSessionOpen(session);
                    session = protonConnection.sessionHead(UNINITIALIZED_SET, INITIALIZED_SET);
                }

                Link link = protonConnection.linkHead(UNINITIALIZED_SET, INITIALIZED_SET);
                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();
                    link.close();
                    link = link.next(ACTIVE_STATE, CLOSED_STATE);
                }

                link = protonConnection.linkHead(ACTIVE_STATE, ALL_STATES);
                while (link != null) {
                    ((AmqpDeliveryListener) link.getContext()).drainCheck();
                    link = link.next(ACTIVE_STATE, ALL_STATES);
                }

                session = protonConnection.sessionHead(ACTIVE_STATE, CLOSED_STATE);
                while (session != null) {
                    // TODO - close links?
View Full Code Here

        }

        Delivery delivery = connection.getWorkHead();
        while (delivery != null)
        {
            Link link = delivery.getLink();
            if (delivery.isUpdated())
            {
                if (link instanceof Sender)
                {
                    delivery.disposition(delivery.getRemoteState());
                }
                StoreEntry e = (StoreEntry) delivery.getContext();
                if (e != null) e.updated();
            }

            if (delivery.isReadable())
            {
                pumpIn( link.getSource().getAddress(), (Receiver)link );
            }

            Delivery next = delivery.getWorkNext();
            delivery.clear();
            delivery = next;
        }

        for (Session session : new Sessions(connection, UNINIT, ANY))
        {
            session.open();
            _logger.log(Level.FINE, "Opened session " + session);
        }
        for (Link link : new Links(connection, UNINIT, ANY))
        {
            //TODO: the following is not correct; should only copy those properties that we understand
            link.setSource(link.getRemoteSource());
            link.setTarget(link.getRemoteTarget());
            linkAdded(link);
            link.open();
            _logger.log(Level.FINE, "Opened link " + link);
        }

        distributeCredit();

        for (Link link : new Links(connection, ACTIVE, ACTIVE))
        {
            if (link instanceof Sender)
            {
                pumpOut(link.getTarget().getAddress(), (Sender)link);
            }
        }

        for (Session session : new Sessions(connection, ACTIVE, CLOSED))
        {
            session.close();
        }

        for (Link link : new Links(connection, ANY, CLOSED))
        {
            if (link.getLocalState() == EndpointState.ACTIVE)
            {
                link.close();
            }
            else
            {
                reclaimLink(link);
            }
View Full Code Here

                            break;
                        case LINK_REMOTE_STATE:
                            processLinkEvent(event.getLink());
                            break;
                        case LINK_FLOW:
                            Link link = event.getLink();
                            ((AmqpDeliveryListener) link.getContext()).drainCheck();
                            break;
                        case DELIVERY:
                            processDelivery(event.getDelivery());
                            break;
                        default:
View Full Code Here

TOP

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

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.