Apache CXF API

org.apache.cxf.transport.jms
Class JMSUtils

java.lang.Object
  extended by org.apache.cxf.transport.jms.JMSUtils

public final class JMSUtils
extends Object


Method Summary
static void addContentTypeToProtocolHeader(Message message)
           
protected static void addProtocolHeaders(javax.jms.Message message, Map<String,List<String>> headers)
           
static javax.jms.Message buildJMSMessageFromCXFMessage(JMSConfiguration jmsConfig, Message outMessage, Object payload, String messageType, javax.jms.Session session, javax.jms.Destination replyTo, String correlationId)
           
static javax.jms.Message createAndSetPayload(Object payload, javax.jms.Session session, String messageType)
          Create a JMS of the appropriate type populated with the given payload.
static String createCorrelationId(String prefix, long i)
           
static String getContentEncoding(Message message)
           
static String getContentType(Message message)
           
static long getTimeToLive(JMSMessageHeadersType headers)
           
static void initResponseMessageProperties(JMSMessageHeadersType messageProperties, JMSMessageHeadersType inMessageProperties)
           
static void populateIncomingContext(javax.jms.Message message, Message inMessage, String messageType, JMSConfiguration jmsConfig)
           
static void retrieveAndSetPayload(Message inMessage, javax.jms.Message message, String encoding)
          Extract the payload of an incoming message.
static void setMessageProperties(JMSMessageHeadersType headers, javax.jms.Message message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTimeToLive

public static long getTimeToLive(JMSMessageHeadersType headers)

setMessageProperties

public static void setMessageProperties(JMSMessageHeadersType headers,
                                        javax.jms.Message message)
                                 throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createAndSetPayload

public static javax.jms.Message createAndSetPayload(Object payload,
                                                    javax.jms.Session session,
                                                    String messageType)
                                             throws javax.jms.JMSException
Create a JMS of the appropriate type populated with the given payload.

Parameters:
payload - the message payload, expected to be either of type String or byte[] depending on payload type
session - the JMS session
replyTo - the ReplyTo destination if any
Returns:
a JMS of the appropriate type populated with the given payload
Throws:
javax.jms.JMSException

retrieveAndSetPayload

public static void retrieveAndSetPayload(Message inMessage,
                                         javax.jms.Message message,
                                         String encoding)
                                  throws UnsupportedEncodingException
Extract the payload of an incoming message.

Parameters:
inMessage -
message - the incoming message
encoding - the message encoding
Throws:
UnsupportedEncodingException

populateIncomingContext

public static void populateIncomingContext(javax.jms.Message message,
                                           Message inMessage,
                                           String messageType,
                                           JMSConfiguration jmsConfig)
                                    throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

addProtocolHeaders

protected static void addProtocolHeaders(javax.jms.Message message,
                                         Map<String,List<String>> headers)
                                  throws javax.jms.JMSException
Throws:
javax.jms.JMSException

addContentTypeToProtocolHeader

public static void addContentTypeToProtocolHeader(Message message)

getContentType

public static String getContentType(Message message)

getContentEncoding

public static String getContentEncoding(Message message)

buildJMSMessageFromCXFMessage

public static javax.jms.Message buildJMSMessageFromCXFMessage(JMSConfiguration jmsConfig,
                                                              Message outMessage,
                                                              Object payload,
                                                              String messageType,
                                                              javax.jms.Session session,
                                                              javax.jms.Destination replyTo,
                                                              String correlationId)
                                                       throws javax.jms.JMSException
Throws:
javax.jms.JMSException

initResponseMessageProperties

public static void initResponseMessageProperties(JMSMessageHeadersType messageProperties,
                                                 JMSMessageHeadersType inMessageProperties)
Parameters:
messageProperties -
inMessageProperties -

createCorrelationId

public static String createCorrelationId(String prefix,
                                         long i)

Apache CXF API

Apache CXF