Spring Web Services Framework

org.springframework.ws.transport.jms.support
Class JmsTransportUtils

java.lang.Object
  extended by org.springframework.ws.transport.jms.support.JmsTransportUtils

public abstract class JmsTransportUtils
extends Object

Collection of utility methods to work with JMS transports. Includes methods to retrieve JMS properties from an URI.

Since:
1.5.0
Author:
Arjen Poutsma

Method Summary
static void addHeader(Message message, String name, String value)
          Adds the given header to the specified message.
static int getDeliveryMode(URI uri)
          Returns the delivery mode of the given URI.
static String getDestinationName(URI uri)
          Returns the destination name of the given URI.
static Iterator<String> getHeaderNames(Message message)
          Returns an iterator over all header names in the given message.
static Iterator<String> getHeaders(Message message, String name)
          Returns an iterator over all the header values of the given message and header name.
static int getMessageType(URI uri)
          Returns the message type of the given URI.
static int getPriority(URI uri)
          Returns the priority of the given URI.
static String getReplyToName(URI uri)
          Returns the reply-to name of the given URI.
static long getTimeToLive(URI uri)
          Returns the lifetime, in milliseconds, of the given URI.
static String headerToJmsProperty(String headerName)
          Converts the given transport header to a JMS property name.
static String jmsPropertyToHeader(String propertyName)
          Converts the given JMS property name to a transport header name.
static URI toUri(Destination destination)
          Converts the given JMS destination into a jms URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

headerToJmsProperty

public static String headerToJmsProperty(String headerName)
Converts the given transport header to a JMS property name. Returns the given header name if no match is found.

Parameters:
headerName - the header name to transform
Returns:
the JMS property name

jmsPropertyToHeader

public static String jmsPropertyToHeader(String propertyName)
Converts the given JMS property name to a transport header name. Returns the given property name if no match is found.

Parameters:
propertyName - the JMS property name to transform
Returns:
the transport header name

toUri

public static URI toUri(Destination destination)
                 throws URISyntaxException,
                        JMSException
Converts the given JMS destination into a jms URI.

Parameters:
destination - the destination
Returns:
a jms URI
Throws:
URISyntaxException
JMSException

getDestinationName

public static String getDestinationName(URI uri)
Returns the destination name of the given URI.


addHeader

public static void addHeader(Message message,
                             String name,
                             String value)
                      throws JMSException
Adds the given header to the specified message.

Throws:
JMSException

getHeaderNames

public static Iterator<String> getHeaderNames(Message message)
                                       throws JMSException
Returns an iterator over all header names in the given message. Delegates to jmsPropertyToHeader(String).

Throws:
JMSException

getHeaders

public static Iterator<String> getHeaders(Message message,
                                          String name)
                                   throws JMSException
Returns an iterator over all the header values of the given message and header name. Delegates to headerToJmsProperty(String).

Throws:
JMSException

getDeliveryMode

public static int getDeliveryMode(URI uri)
Returns the delivery mode of the given URI.

See Also:
DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT, Message.DEFAULT_DELIVERY_MODE

getMessageType

public static int getMessageType(URI uri)
Returns the message type of the given URI. Defaults to JmsTransportConstants.BYTES_MESSAGE_TYPE.

See Also:
JmsTransportConstants.BYTES_MESSAGE_TYPE, JmsTransportConstants.TEXT_MESSAGE_TYPE

getTimeToLive

public static long getTimeToLive(URI uri)
Returns the lifetime, in milliseconds, of the given URI.

See Also:
Message.DEFAULT_TIME_TO_LIVE

getPriority

public static int getPriority(URI uri)
Returns the priority of the given URI.

See Also:
Message.DEFAULT_PRIORITY

getReplyToName

public static String getReplyToName(URI uri)
Returns the reply-to name of the given URI.

See Also:
Message.setJMSReplyTo(Destination)

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.