Package org.apache.qpid

Examples of org.apache.qpid.AMQInvalidArgumentException


            {
                selector = new JMSSelectorFilter(selectorString);
            }
            catch (ParseException e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            catch (SelectorParsingException e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            catch (TokenMgrError e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            _selectorCache.put(selectorString, new WeakReference<JMSSelectorFilter>(selector));
        }
        return selector;
    }
View Full Code Here


                    {
                        manager.add(new JMSSelectorFilter((String)selector));
                    }
                    catch (ParseException e)
                    {
                        throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selector + "\"", e);
                    }
                    catch (SelectorParsingException e)
                    {
                        throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selector + "\"", e);
                    }
                    catch (TokenMgrError e)
                    {
                        throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selector + "\"", e);
                    }
                }

            }
View Full Code Here

            {
                selector = new JMSSelectorFilter(selectorString);
            }
            catch (ParseException e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            catch (SelectorParsingException e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            catch (TokenMgrError e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            _selectorCache.put(selectorString, new WeakReference<JMSSelectorFilter>(selector));
        }
        return selector;
    }
View Full Code Here

{

    public void testExceptionReceived()
    {
        String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'";
        AMQInvalidArgumentException expectedException = new AMQInvalidArgumentException("Test", null);
        final AtomicReference<JMSException> receivedException = new AtomicReference<JMSException>();
        try
        {
            MockAMQConnection connection = new MockAMQConnection(url);
            connection.setExceptionListener(new ExceptionListener()
            {

                @Override
                public void onException(JMSException jmsException)
                {
                    receivedException.set(jmsException);
                }
            });
            connection.exceptionReceived(expectedException);
        }
        catch (Exception e)
        {
            fail("Failure to test exceptionRecived:" + e.getMessage());
        }
        JMSException exception = receivedException.get();
        assertNotNull("Expected JMSException but got null", exception);
        assertEquals("JMSException error code is incorrect", Integer.toString(expectedException.getErrorCode().getCode()), exception.getErrorCode());
        assertNotNull("Expected not null message for JMSException", exception.getMessage());
        assertTrue("JMSException error message is incorrect",  exception.getMessage().contains(expectedException.getMessage()));
        assertEquals("JMSException linked exception is incorrect", expectedException, exception.getLinkedException());
    }
View Full Code Here

            {
                selector = new JMSSelectorFilter(selectorString);
            }
            catch (ParseException e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            catch (SelectorParsingException e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            catch (TokenMgrError e)
            {
                throw new AMQInvalidArgumentException("Cannot parse JMS selector \"" + selectorString + "\"", e);
            }
            _selectorCache.put(selectorString, new WeakReference<JMSSelectorFilter>(selector));
        }
        return selector;
    }
View Full Code Here

            }
            else if (errorCode == AMQConstant.ARGUMENT_INVALID)
            {
                _logger.debug("Broker responded with Invalid Argument.");

                throw new AMQInvalidArgumentException(String.valueOf(reason), null);
            }
            else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
            {
                _logger.debug("Broker responded with Invalid Routing Key.");
View Full Code Here

            }
            else if (errorCode == AMQConstant.INVALID_ARGUMENT)
            {
                _logger.debug("Broker responded with Invalid Argument.");

                throw new AMQInvalidArgumentException(String.valueOf(reason));
            }
            else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
            {
                _logger.debug("Broker responded with Invalid Routing Key.");
View Full Code Here

            int b = input.readByte();
            _globalTransactionID = new byte[g];
            _branchQualifier = new byte[b];
            if (input.read(_globalTransactionID, 0, g) != g)
            {
                throw new AMQInvalidArgumentException("Cannot convert the string " + xid + " into an Xid", null);
            }
            if (input.read(_branchQualifier, 0, b) != b)
            {
                throw new AMQInvalidArgumentException("Cannot convert the string " + xid + " into an Xid", null);
            }
        }
        catch (IOException e)
        {
            throw new AMQInvalidArgumentException("cannot convert the string " + xid + " into an Xid", e);
        }
    }
View Full Code Here

        try {
            return this.JmsSelector();
        }
        catch (Throwable e) {
                throw (AMQInvalidArgumentException)new AMQInvalidArgumentException(sql,e);
        }

    }
View Full Code Here

            int b = input.readByte();
            _globalTransactionID = new byte[g];
            _branchQualifier = new byte[b];
            if (input.read(_globalTransactionID, 0, g) != g)
            {
                throw new AMQInvalidArgumentException("Cannot convert the string " + xid + " into an Xid", null);
            }
            if (input.read(_branchQualifier, 0, b) != b)
            {
                throw new AMQInvalidArgumentException("Cannot convert the string " + xid + " into an Xid", null);
            }
        }
        catch (IOException e)
        {
            throw new AMQInvalidArgumentException("cannot convert the string " + xid + " into an Xid", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.AMQInvalidArgumentException

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.