Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.MethodRegistry


        else
        {
            _logger.error("Exception caught in" + session + ", closing session explictly: " + throwable, throwable);


            MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(session.getProtocolVersion());
            ConnectionCloseBody closeBody = methodRegistry.createConnectionCloseBody(200,new AMQShortString(throwable.getMessage()),0,0);
                       
            protocolSession.write(closeBody.generateFrame(0));

            protocolSession.close();
        }
View Full Code Here


     * @throws JMException
     */
    public void closeConnection() throws JMException
    {

        MethodRegistry methodRegistry = _session.getMethodRegistry();
        ConnectionCloseBody responseBody =
                methodRegistry.createConnectionCloseBody(AMQConstant.REPLY_SUCCESS.getCode(),
                                                         // replyCode
                                                         BROKER_MANAGEMENT_CONSOLE_HAS_CLOSED_THE_CONNECTION,
                                                         // replyText,
                                                         0,
                                                         0);
View Full Code Here


                if(!body.getNowait())
                {

                    MethodRegistry methodRegistry = session.getMethodRegistry();
                    AMQMethodBody responseBody = methodRegistry.createQueuePurgeOkBody(purged);
                    session.writeFrame(responseBody.generateFrame(channelId));
                   
                }
        }
    }
View Full Code Here

            channel.setDefaultQueue(queue);
        }

        if (!body.getNowait())
        {
            MethodRegistry methodRegistry = session.getMethodRegistry();
            QueueDeclareOkBody responseBody =
                    methodRegistry.createQueueDeclareOkBody(queueName,
                                                            queue.getMessageCount(),
                                                            queue.getConsumerCount());
            session.writeFrame(responseBody.generateFrame(channelId));

            _logger.info("Queue " + queueName + " declared successfully");
View Full Code Here

                if (queue.isDurable())
                {
                    store.removeQueue(queue);
                }

                MethodRegistry methodRegistry = session.getMethodRegistry();
                QueueDeleteOkBody responseBody = methodRegistry.createQueueDeleteOkBody(purged);
                session.writeFrame(responseBody.generateFrame(channelId));
            }
        }
    }
View Full Code Here

                    throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, "Permission denied");
                }

                if (!performGet(queue,session, channel, !body.getNoAck()))
                {
                    MethodRegistry methodRegistry = session.getMethodRegistry();
                    // TODO - set clusterId
                    BasicGetEmptyBody responseBody = methodRegistry.createBasicGetEmptyBody(null);


                    session.writeFrame(responseBody.generateFrame(channelId));
                }
            }
View Full Code Here

            props.setContentType("text/plain");
            props.setType("text/plain");
            props.setMessageId("whatever");
            props.setEncoding("UTF-8");
            props.getHeaders().setString("Test", "MST");
            MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(ProtocolVersion.v0_9);
            int classForBasic = methodRegistry.createBasicQosOkBody().getClazz();
            ContentHeaderBody contentHeaderBody = new ContentHeaderBody(classForBasic, 1, props, bodySize);

            // add content entry to database
            long messageId = store.getNewMessageId();
            TupleBinding<MessageContentKey> contentKeyTB = new MessageContentKeyTupleBindingFactory(storeVersion).getInstance();
View Full Code Here

    }

    private ContentHeaderBody createContentHeaderBody_0_8(BasicContentHeaderProperties props, int length)
    {
        MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(ProtocolVersion.v0_9);
        int classForBasic = methodRegistry.createBasicQosOkBody().getClazz();
        return new ContentHeaderBody(classForBasic, 1, props, length);
    }
View Full Code Here

     */
    public abstract void acknowledgeMessage(long deliveryTag, boolean multiple);

    public MethodRegistry getMethodRegistry()
    {
        MethodRegistry methodRegistry = getProtocolHandler().getMethodRegistry();
        return methodRegistry;
    }
View Full Code Here

        }
    }

    private void flow(boolean flow)
    {
        MethodRegistry methodRegistry = _session.getMethodRegistry();
        AMQMethodBody responseBody = methodRegistry.createChannelFlowBody(flow);
        _session.writeFrame(responseBody.generateFrame(_channelId));
    }
View Full Code Here

TOP

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

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.