org.apache.camel.component.sjms
Class SjmsExchangeMessageHelper

java.lang.Object
  extended by org.apache.camel.component.sjms.SjmsExchangeMessageHelper

public final class SjmsExchangeMessageHelper
extends Object


Method Summary
static org.apache.camel.Exchange createExchange(javax.jms.Message message, org.apache.camel.Endpoint endpoint)
           
static javax.jms.Message createMessage(org.apache.camel.Exchange exchange, javax.jms.Session session, KeyFormatStrategy keyFormatStrategy)
           
static Boolean getJMSRedelivered(javax.jms.Message message)
          Gets the JMSRedelivered from the message.
static javax.jms.Destination getJMSReplyTo(javax.jms.Message message)
          Gets the JMSReplyTo from the message.
static String getJMSType(javax.jms.Message message)
          Gets the JMSType from the message.
static boolean hasProperty(javax.jms.Message jmsMessage, String name)
          Tests whether a given property with the name exists
static String normalizeDestinationName(String destination)
          Normalizes the destination name, by removing any leading queue or topic prefixes.
static org.apache.camel.Exchange populateExchange(javax.jms.Message message, org.apache.camel.Exchange exchange, boolean out)
           
static Object removeJmsProperty(javax.jms.Message jmsMessage, String name)
          Removes the property from the JMS message.
static void setCorrelationId(javax.jms.Message message, String correlationId)
          Sets the correlation id on the JMS message.
static void setJMSDeliveryMode(org.apache.camel.Exchange exchange, javax.jms.Message message, Object deliveryMode)
          Sets the JMSDeliveryMode on the message.
static javax.jms.Message setJmsMessageHeaders(org.apache.camel.Exchange exchange, javax.jms.Message jmsMessage)
           
static org.apache.camel.Exchange setJmsMessageHeaders(javax.jms.Message jmsMessage, org.apache.camel.Exchange exchange, boolean out)
           
static void setJMSReplyTo(javax.jms.Message message, javax.jms.Destination replyTo)
          Sets the JMSReplyTo on the message.
static void setProperty(javax.jms.Message jmsMessage, String name, Object value)
          Sets the property on the given JMS message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createExchange

public static org.apache.camel.Exchange createExchange(javax.jms.Message message,
                                                       org.apache.camel.Endpoint endpoint)

populateExchange

public static org.apache.camel.Exchange populateExchange(javax.jms.Message message,
                                                         org.apache.camel.Exchange exchange,
                                                         boolean out)

removeJmsProperty

public static Object removeJmsProperty(javax.jms.Message jmsMessage,
                                       String name)
                                throws javax.jms.JMSException
Removes the property from the JMS message.

Parameters:
jmsMessage - the JMS message
name - name of the property to remove
Returns:
the old value of the property or null if not exists
Throws:
javax.jms.JMSException - can be thrown

hasProperty

public static boolean hasProperty(javax.jms.Message jmsMessage,
                                  String name)
                           throws javax.jms.JMSException
Tests whether a given property with the name exists

Parameters:
jmsMessage - the JMS message
name - name of the property to test if exists
Returns:
true if the property exists, false if not.
Throws:
javax.jms.JMSException - can be thrown

setProperty

public static void setProperty(javax.jms.Message jmsMessage,
                               String name,
                               Object value)
                        throws javax.jms.JMSException
Sets the property on the given JMS message.

Parameters:
jmsMessage - the JMS message
name - name of the property to set
value - the value
Throws:
javax.jms.JMSException - can be thrown

setCorrelationId

public static void setCorrelationId(javax.jms.Message message,
                                    String correlationId)
Sets the correlation id on the JMS message.

Will ignore exception thrown

Parameters:
message - the JMS message
correlationId - the correlation id

normalizeDestinationName

public static String normalizeDestinationName(String destination)
Normalizes the destination name, by removing any leading queue or topic prefixes.

Parameters:
destination - the destination
Returns:
the normalized destination

setJMSReplyTo

public static void setJMSReplyTo(javax.jms.Message message,
                                 javax.jms.Destination replyTo)
Sets the JMSReplyTo on the message.

Parameters:
message - the message
replyTo - the reply to destination

getJMSReplyTo

public static javax.jms.Destination getJMSReplyTo(javax.jms.Message message)
Gets the JMSReplyTo from the message.

Parameters:
message - the message
Returns:
the reply to, can be null

getJMSType

public static String getJMSType(javax.jms.Message message)
Gets the JMSType from the message.

Parameters:
message - the message
Returns:
the type, can be null

getJMSRedelivered

public static Boolean getJMSRedelivered(javax.jms.Message message)
Gets the JMSRedelivered from the message.

Parameters:
message - the message
Returns:
true if redelivered, false if not, null if not able to determine

setJMSDeliveryMode

public static void setJMSDeliveryMode(org.apache.camel.Exchange exchange,
                                      javax.jms.Message message,
                                      Object deliveryMode)
                               throws javax.jms.JMSException
Sets the JMSDeliveryMode on the message.

Parameters:
exchange - the exchange
message - the message
deliveryMode - the delivery mode, either as a String or integer
Throws:
javax.jms.JMSException - is thrown if error setting the delivery mode

setJmsMessageHeaders

public static javax.jms.Message setJmsMessageHeaders(org.apache.camel.Exchange exchange,
                                                     javax.jms.Message jmsMessage)
                                              throws Exception
Throws:
Exception

setJmsMessageHeaders

public static org.apache.camel.Exchange setJmsMessageHeaders(javax.jms.Message jmsMessage,
                                                             org.apache.camel.Exchange exchange,
                                                             boolean out)
                                                      throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createMessage

public static javax.jms.Message createMessage(org.apache.camel.Exchange exchange,
                                              javax.jms.Session session,
                                              KeyFormatStrategy keyFormatStrategy)
                                       throws Exception
Throws:
Exception


Apache Camel