Examples of AMQConstant


Examples of org.apache.qpid.protocol.AMQConstant

                {
                    // Bounced message is processed here, away from the mina thread
                    AbstractJMSMessage bouncedMessage =
                            _messageFactoryRegistry.createMessage(0, false, msg.getExchange(),
                                                                  msg.getRoutingKey(), msg.getContentHeader(), msg.getBodies());
                    AMQConstant errorCode = AMQConstant.getConstant(msg.getReplyCode());
                    AMQShortString reason = msg.getReplyText();
                    _logger.debug("Message returned with error code " + errorCode + " (" + reason + ")");

                    // @TODO should this be moved to an exception handler of sorts. Somewhere errors are converted to correct execeptions.
                    if (errorCode == AMQConstant.NO_CONSUMERS)
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

        {
            je = (JMSException) cause;
        }
        else
        {
            AMQConstant code = null;

            if (cause instanceof AMQException)
            {
                code = ((AMQException) cause).getErrorCode();
            }

            if (code != null)
            {
                je =
                        new JMSException(Integer.toString(code.getCode()), "Exception thrown against " + toString() + ": "
                                                                           + cause);
            }
            else
            {
                //Should never get here as all AMQEs are required to have an ErrorCode!
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

        throws AMQException
    {
        _logger.debug("ChannelClose method received");
        ChannelCloseBody method = (ChannelCloseBody) evt.getMethod();

        AMQConstant errorCode = AMQConstant.getConstant(method.replyCode);
        AMQShortString reason = method.replyText;
        if (_logger.isDebugEnabled())
        {
            _logger.debug("Channel close reply code: " + errorCode + ", reason: " + reason);
        }
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

        ConnectionCloseBody method = (ConnectionCloseBody) evt.getMethod();

        // does it matter
        // stateManager.changeState(AMQState.CONNECTION_CLOSING);

        AMQConstant errorCode = AMQConstant.getConstant(method.replyCode);
        AMQShortString reason = method.replyText;

        try
        {
            // TODO: check whether channel id of zero is appropriate
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

                    // Bounced message is processed here, away from the mina thread
                    AbstractJMSMessage bouncedMessage =
                            _messageFactoryRegistry.createMessage(0, false, message.getBounceBody().exchange,
                                                                  message.getBounceBody().routingKey, message.getContentHeader(), message.getBodies());

                    AMQConstant errorCode = AMQConstant.getConstant(message.getBounceBody().replyCode);
                    AMQShortString reason = message.getBounceBody().replyText;
                    _logger.debug("Message returned with error code " + errorCode + " (" + reason + ")");

                    // @TODO should this be moved to an exception handler of sorts. Somewhere errors are converted to correct execeptions.
                    if (errorCode == AMQConstant.NO_CONSUMERS)
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

        throws AMQException
    {
        _logger.debug("ChannelClose method received");
        ChannelCloseBody method = (ChannelCloseBody) evt.getMethod();

        AMQConstant errorCode = AMQConstant.getConstant(method.replyCode);
        AMQShortString reason = method.replyText;
        if (_logger.isDebugEnabled())
        {
            _logger.debug("Channel close reply code: " + errorCode + ", reason: " + reason);
        }
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

    public void methodReceived(AMQProtocolSession session, ChannelCloseBody method, int channelId)
            throws AMQException
    {
        _logger.debug("ChannelClose method received");

        AMQConstant errorCode = AMQConstant.getConstant(method.getReplyCode());
        AMQShortString reason = method.getReplyText();
        if (_logger.isDebugEnabled())
        {
            _logger.debug("Channel close reply code: " + errorCode + ", reason: " + reason);
        }
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

                {
                    // Bounced message is processed here, away from the mina thread
                    AbstractJMSMessage bouncedMessage =
                            _messageFactoryRegistry.createMessage(0, false, msg.getExchange(),
                                                                  msg.getRoutingKey(), msg.getContentHeader(), msg.getBodies());
                    AMQConstant errorCode = AMQConstant.getConstant(msg.getReplyCode());
                    AMQShortString reason = msg.getReplyText();
                    _logger.debug("Message returned with error code " + errorCode + " (" + reason + ")");

                    // @TODO should this be moved to an exception handler of sorts. Somewhere errors are converted to correct execeptions.
                    if (errorCode == AMQConstant.NO_CONSUMERS)
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

            Exception linkedException = e.getLinkedException();
            assertNotNull("There was no linked exception", linkedException);
            Throwable cause = linkedException.getCause();
            assertNotNull("Cause was null", cause);
            assertTrue("Wrong linked exception type", cause instanceof AMQException);
            AMQConstant errorCode = isBroker010() ? AMQConstant.CONNECTION_FORCED : AMQConstant.ACCESS_REFUSED;
            assertEquals("Incorrect error code received", errorCode, ((AMQException) cause).getErrorCode());
        }
    }
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

        {
            return new ProtocolVersion(pe.getMajor(), pe.getMinor());
        }
        catch (ConnectionException ce)
        {
            AMQConstant code = AMQConstant.REPLY_SUCCESS;
            if (ce.getClose() != null && ce.getClose().getReplyCode() != null)
            {
                code = AMQConstant.getConstant(ce.getClose().getReplyCode().getValue());
            }
            String msg = "Cannot connect to broker: " + ce.getMessage();
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.