Java Code Examples for javax.jms.Message.getClass()

The following are Jave code examples for showing how to use getClass() of the javax.jms.Message class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: OperatieBRP   File:   Source Code and License Vote up 5 votes
private static String leesBericht(final Message message) {
    final String result;
    if (message instanceof TextMessage) {
        try {
            result = ((TextMessage) message).getText();
        } catch (JMSException e) {
            throw new IllegalArgumentException("Kan text uit bericht niet lezen.", e);
    } else {
        throw new IllegalArgumentException("Message type niet ondersteund: " + message.getClass());
    return result;