org.mule.providers.jms
Class JmsMessageUtils

java.lang.Object
  extended byorg.mule.providers.jms.JmsMessageUtils

public class JmsMessageUtils
extends Object

JmsMessageUtils contains helper method for dealing with JMS messages in Mule.


Constructor Summary
JmsMessageUtils()
           
 
Method Summary
static Message copyJMSProperties(Message from, Message to, JmsConnector connector)
           
static String getNameForDestination(Destination dest)
           
static byte[] toByteArray(Message message, String jmsSpec)
           
static Message toMessage(Object object, Session session)
           
static Object toObject(Message source, String jmsSpec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsMessageUtils

public JmsMessageUtils()
Method Detail

toMessage

public static Message toMessage(Object object,
                                Session session)
                         throws JMSException
Throws:
JMSException

toObject

public static Object toObject(Message source,
                              String jmsSpec)
                       throws JMSException,
                              IOException
Throws:
JMSException
IOException

toByteArray

public static byte[] toByteArray(Message message,
                                 String jmsSpec)
                          throws JMSException,
                                 IOException
Parameters:
message - the message to receive the bytes from. Note this only works for TextMessge, ObjectMessage, StreamMessage and BytesMessage.
jmsSpec - indicates the JMS API version, either JmsConstants.JMS_SPECIFICATION_102B or JmsConstants.JMS_SPECIFICATION_11. Any other value including null is treated as fallback to JmsConstants.JMS_SPECIFICATION_102B.
Returns:
a byte array corresponding with the message payload
Throws:
JMSException - if the message can't be read or if the message passed is a MapMessage
IOException - if a failure occurs while reading the stream and converting the message data

getNameForDestination

public static String getNameForDestination(Destination dest)
                                    throws JMSException
Throws:
JMSException

copyJMSProperties

public static Message copyJMSProperties(Message from,
                                        Message to,
                                        JmsConnector connector)
                                 throws JMSException
Throws:
JMSException


Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.