Examples of AMQConstant


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

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

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

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

Examples of org.apache.qpid.protocol.AMQConstant

        _logger.info("ConnectionClose frame received");

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

        AMQConstant errorCode = AMQConstant.getConstant(method.getReplyCode());
        AMQShortString reason = method.getReplyText();

        AMQException error = null;

        try
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

            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.CONTEXT_IN_USE : AMQConstant.ACCESS_REFUSED;
            assertEquals("Incorrect error code received", errorCode, ((AMQException) cause).getErrorCode());
        }
    }
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

        {
            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!
                // Other than AMQDisconnectedEx!
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("Exception thrown against " + toString() + ": " + cause, Integer.toString(code.getCode()));
            }
            else
            {
                //Should never get here as all AMQEs are required to have an ErrorCode!
                // Other than AMQDisconnectedEx!
View Full Code Here

Examples of org.apache.qpid.protocol.AMQConstant

    JMSException toJMSException(String message, AMQException e)
    {
        JMSException ex;

        AMQConstant errorCode = e.getErrorCode();
        if (errorCode == AMQConstant.ACCESS_REFUSED)
        {
            ex = new JMSSecurityException(message, String.valueOf(errorCode.getCode()));
        }
        else
        {
            ex = new JMSException(message, errorCode == null ? null : String.valueOf(errorCode.getCode()));
        }
        ex.initCause(e);

        ex.setLinkedException(e);
        return ex;
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
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.