Package javax.jms

Examples of javax.jms.MessageFormatException


    @SuppressWarnings("unchecked")
    public static <T> List<T> getList(final Message message) throws JMSException
    {
        if (message == null)
        {
            throw new MessageFormatException("Attempting to do AMQPMessage.getList() on null Message");
        }
        else if (message instanceof BytesMessage)
        {
            BytesMessage msg = (BytesMessage)message;
View Full Code Here


    public static void setList(final Message message, final List list) throws JMSException
    {
        String type = getContentType(message);
        if (!type.equals("amqp/list"))
        {
            throw new MessageFormatException("Can only do setList() on amqp/list encoded Message");
        }

        if (message == null)
        {
            throw new MessageFormatException("Attempting to do AMQPMessage.setList() on null Message");
        }
        else if (message instanceof BytesMessage)
        {
            BBEncoder encoder = new BBEncoder(1024);
            encoder.writeList(list);
            ByteBuffer buf = encoder.segment();
            byte[] data = new byte[buf.limit()];
            buf.get(data);
            ((BytesMessage)message).writeBytes(data);
        }
        else
        {
            throw new MessageFormatException("Attempting to do setList() on " + message.getClass().getCanonicalName());
        }
    }
View Full Code Here

        {
            return Boolean.valueOf((String) value);
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to boolean.");
        }

    }
View Full Code Here

        {
            return Byte.valueOf((String) value).byteValue();
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to byte.");
        }
    }
View Full Code Here

        {
            return Short.valueOf((String) value).shortValue();
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to short.");
        }

    }
View Full Code Here

        {
            return Integer.valueOf((String) value).intValue();
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to int.");
        }

    }
View Full Code Here

        {
            return Long.valueOf((String) value).longValue();
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to long.");
        }

    }
View Full Code Here

    {
        Object value = _map.get(propName);

        if (!_map.containsKey(propName))
        {
            throw new MessageFormatException("Property " + propName + " not present");
        }
        else if (value instanceof Character)
        {
            return ((Character) value).charValue();
        }
        else if (value == null)
        {
            throw new NullPointerException("Property " + propName + " has null value and therefore cannot "
                + "be converted to char.");
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to boolan.");
        }

    }
View Full Code Here

        {
            return Float.valueOf((String) value).floatValue();
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to float.");
        }
    }
View Full Code Here

        {
            return Double.valueOf((String) value).doubleValue();
        }
        else
        {
            throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
                + " cannot be converted to double.");
        }
    }
View Full Code Here

TOP

Related Classes of javax.jms.MessageFormatException

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.