Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.AMQFrame


                    new FailoverRetrySupport<AMQMethodEvent, AMQException>(
                            new FailoverProtectedOperation<AMQMethodEvent, AMQException>()
                            {
                                public AMQMethodEvent execute() throws AMQException, FailoverException
                                {
                                    AMQFrame boundFrame =
                                            ExchangeBoundBody.createAMQFrame(_channelId, getProtocolMajorVersion(),
                                                                             getProtocolMinorVersion(), exchangeName, // exchange
                                                                             queueName, // queue
                                                                             routingKey); // routingKey
View Full Code Here


        _consumers.put(tag, consumer);

        try
        {
            // TODO: Be aware of possible changes to parameter order as versions change.
            AMQFrame jmsConsume =
                    BasicConsumeBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(), arguments, // arguments
                                                    tag, // consumerTag
                                                    consumer.isExclusive(), // exclusive
                                                    consumer.getAcknowledgeMode() == Session.NO_ACKNOWLEDGE, // noAck
                                                    consumer.isNoLocal(), // noLocal
View Full Code Here

    {
        new FailoverNoopSupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
        {
            public Object execute() throws AMQException, FailoverException
            {
                AMQFrame exchangeDeclare =
                        ExchangeDeclareBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
                                                           null, // arguments
                                                           false, // autoDelete
                                                           false, // durable
                                                           name, // exchange
View Full Code Here

                        if (amqd.isNameRequired())
                        {
                            amqd.setQueueName(protocolHandler.generateQueueName());
                        }

                        AMQFrame queueDeclare =
                                QueueDeclareBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
                                                                null, // arguments
                                                                amqd.isAutoDelete(), // autoDelete
                                                                amqd.isDurable(), // durable
                                                                amqd.isExclusive(), // exclusive
View Full Code Here

        {
            new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
            {
                public Object execute() throws AMQException, FailoverException
                {
                    AMQFrame queueDeleteFrame =
                            QueueDeleteBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
                                                           false, // ifEmpty
                                                           false, // ifUnused
                                                           true, // nowait
                                                           queueName, // queue
View Full Code Here

                    _logger.debug("Setting channel flow : " + (suspend ? "suspended" : "unsuspended"));
                }

                _suspended = suspend;

                AMQFrame channelFlowFrame =
                        ChannelFlowBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
                                                       !suspend);

                _connection.getProtocolHandler().syncWrite(channelFlowFrame, ChannelFlowOkBody.class);
            }
View Full Code Here

        if (debug && ((msgNumber % 1000) == 0))
        {
            _logger.debug("Received " + _messageReceivedCount + " protocol messages");
        }

        AMQFrame frame = (AMQFrame) message;

        final AMQBody bodyFrame = frame.getBodyFrame();

        HeartbeatDiagnostics.received(bodyFrame instanceof HeartbeatBody);

        switch (bodyFrame.getFrameType())
        {
        case AMQMethodBody.TYPE:

            if (debug)
            {
                _logger.debug("(" + System.identityHashCode(this) + ")Method frame received: " + frame);
            }

            final AMQMethodEvent<AMQMethodBody> evt =
                new AMQMethodEvent<AMQMethodBody>(frame.getChannel(), (AMQMethodBody) bodyFrame);

            try
            {

                boolean wasAnyoneInterested = getStateManager().methodReceived(evt);
                if (!_frameListeners.isEmpty())
                {
                    Iterator it = _frameListeners.iterator();
                    while (it.hasNext())
                    {
                        final AMQMethodListener listener = (AMQMethodListener) it.next();
                        wasAnyoneInterested = listener.methodReceived(evt) || wasAnyoneInterested;
                    }
                }

                if (!wasAnyoneInterested)
                {
                    throw new AMQException("AMQMethodEvent " + evt + " was not processed by any listener.  Listeners:"
                        + _frameListeners);
                }
            }
            catch (AMQException e)
            {
                getStateManager().error(e);
                if (!_frameListeners.isEmpty())
                {
                    Iterator it = _frameListeners.iterator();
                    while (it.hasNext())
                    {
                        final AMQMethodListener listener = (AMQMethodListener) it.next();
                        listener.error(e);
                    }
                }

                exceptionCaught(session, e);
            }

            break;

        case ContentHeaderBody.TYPE:

            _protocolSession.messageContentHeaderReceived(frame.getChannel(), (ContentHeaderBody) bodyFrame);
            break;

        case ContentBody.TYPE:

            _protocolSession.messageContentBodyReceived(frame.getChannel(), (ContentBody) bodyFrame);
            break;

        case HeartbeatBody.TYPE:

            if (debug)
View Full Code Here

        getStateManager().changeState(AMQState.CONNECTION_CLOSING);

        // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
        // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
        // Be aware of possible changes to parameter order as versions change.
        final AMQFrame frame =
            ConnectionCloseBody.createAMQFrame(0, _protocolSession.getProtocolMajorVersion(),
                _protocolSession.getProtocolMinorVersion(), // AMQP version (major, minor)
                0, // classId
                0, // methodId
                AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
View Full Code Here

    {
        if(_replay != null)
        {
            for(AMQMethodBody b : _replay)
            {
                _session.write(new AMQFrame(0, b));
            }
        }
    }
View Full Code Here

        _body = body;
    }

    public void send(int channel, Member member) throws AMQException
    {
        member.send(new AMQFrame(channel, _body));
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.framing.AMQFrame

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.