Examples of AMQBody


Examples of org.apache.qpid.framing.AMQBody

        }
    }

    private void handleFrame(AMQFrame frame) throws AMQException
    {
        AMQBody body = frame.getBodyFrame();
        if (body instanceof AMQMethodBody)
        {
            handleMethod(frame.getChannel(), (AMQMethodBody) body);
        }
        else
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

        public AMQDataBlock next()
        {
            try
            {

                AMQBody cb =
                        getProtocolVersionMethodConverter().convertToBody(_messageHandle.getContentChunk(getStoreContext(),
                                                                                                         _messageId, ++_index));

                return new AMQFrame(_channel, cb);
            }
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

    }

    private void frameReceived(AMQFrame frame) throws AMQException
    {
        int channelId = frame.getChannel();
        AMQBody body = frame.getBodyFrame();

        //Look up the Channel's Actor and set that as the current actor
        // If that is not available then we can use the ConnectionActor
        // that is associated with this AMQMPSession.
        LogActor channelActor = null;
        if (_channelMap.get(channelId) != null)
        {
            channelActor = _channelMap.get(channelId).getLogActor();
        }
        CurrentActor.set(channelActor == null ? _actor : channelActor);

        try
        {
            if (_logger.isDebugEnabled())
            {
                _logger.debug("Frame Received: " + frame);
            }

            // Check that this channel is not closing
            if (channelAwaitingClosure(channelId))
            {
                if ((frame.getBodyFrame() instanceof ChannelCloseOkBody))
                {
                    if (_logger.isInfoEnabled())
                    {
                        _logger.info("Channel[" + channelId + "] awaiting closure - processing close-ok");
                    }
                }
                else
                {
                    // The channel has been told to close, we don't process any more frames until
                    // it's closed.
                    return;
                }
            }

            try
            {
                body.handle(channelId, this);
            }
            catch (AMQException e)
            {
                closeChannel(channelId);
                throw e;
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

        //Create a new ProtocolHandler with a fake connection.
        _handler = new AMQProtocolHandler(new MockAMQConnection("amqp://guest:guest@client/test?brokerlist='vm://:1'"));

        _handler.sessionCreated(new MockIoSession());

         AMQBody body = BasicRecoverOkBodyImpl.getFactory().newInstance(null, 1);
        _blockFrame = new AMQFrame(0, body);

        _handleCountDown = new CountDownLatch(1);

        _logger.info("Creating _Listener that should also receive the thrown exception.");
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

        public AMQDataBlock next()
        {
            try
            {

                AMQBody cb =
                        getProtocolVersionMethodConverter().convertToBody(_messageHandle.getContentChunk(getStoreContext(),
                                                                                                         ++_index));

                return new AMQFrame(_channel, cb);
            }
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

                            _logger.debug("Received " + _messageReceivedCount + " protocol messages");
                        }

                        AMQFrame frame = (AMQFrame) message;

                        final AMQBody bodyFrame = frame.getBodyFrame();

                        HeartbeatDiagnostics.received(bodyFrame instanceof HeartbeatBody);

                        bodyFrame.handle(frame.getChannel(), _protocolSession);

                        _connection.bytesReceived(_readBytes);
                    }
                    else if (message instanceof ProtocolInitiation)
                    {
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

    public void setUp() throws Exception
    {
        //Create a new ProtocolHandler with a fake connection.
        _handler = new AMQProtocolHandler(new MockAMQConnection("amqp://guest:guest@client/test?brokerlist='tcp://localhost:1'"));
        _handler.setNetworkConnection(new TestNetworkConnection());
         AMQBody body = BasicRecoverOkBodyImpl.getFactory().newInstance(null, 1);
        _blockFrame = new AMQFrame(0, body);

        _handleCountDown = new CountDownLatch(1);

        _logger.info("Creating _Listener that should also receive the thrown exception.");
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

    }

    public void writeDeliver(QueueEntry entry, int channelId, long deliveryTag, AMQShortString consumerTag)
            throws AMQException
    {
        AMQBody deliverBody = createEncodedDeliverBody(entry, deliveryTag, consumerTag);
        writeMessageDelivery(entry, channelId, deliverBody);
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

            int capacity = bodySize > maxBodySize ? maxBodySize : bodySize;

            int writtenSize = capacity;

            AMQBody firstContentBody = new MessageContentSourceBody(message,0,capacity);

            CompositeAMQBodyBlock
                    compositeBlock = new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody, firstContentBody);
            writeFrame(compositeBlock);
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

        }
    }

    public void writeGetOk(QueueEntry entry, int channelId, long deliveryTag, int queueSize) throws AMQException
    {
        AMQBody deliver = createEncodedGetOkBody(entry, deliveryTag, queueSize);
        writeMessageDelivery(entry, channelId, deliver);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.