|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bss.esb.util.JmsUtil
Utility class for performing common JMS operations. This class provides methods for:
1. Creating a JMS connection (Queue/Topic) given a queue connection factory's JNDI name 2. Get a JMS message's properties. 3. Set the entries found in a given Map as JMS message's properties after detecting the type of each value in the supplied Map. 4. Make a JMS message properties-writable, without losing the original properties set on the JMS message.
Constructor Summary | |
JmsUtil()
|
Method Summary | |
static java.util.HashMap |
getMessageProperties(javax.jms.Message msg)
Returns all the properties that are set a given JMS messages, as HashMap. |
static javax.jms.QueueConnection |
getQueueConnection(java.lang.String qcfName,
boolean started)
Returns a JMS QueueConnection object created after looking up the given queue connection factory. |
static javax.jms.TopicConnection |
getTopicConnection(java.lang.String tcfName,
boolean started)
Returns a JMS TopicConnection object created after looking up the given topic connection factory. |
static void |
makeMessagePropertiesWritable(javax.jms.Message msg)
Makes the JMS message properties-writable without losing the originally set properties on this JMS message. |
static void |
setMessageProperties(java.util.HashMap props,
javax.jms.Message msg)
Sets the entries found in props as the properties
of msg . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JmsUtil()
Method Detail |
public static void makeMessagePropertiesWritable(javax.jms.Message msg) throws javax.jms.JMSException
msg
- The JMS message to be made properties-writable
javax.jms.JMSException
public static java.util.HashMap getMessageProperties(javax.jms.Message msg) throws javax.jms.JMSException
msg
- The JMS message whose properties are to be obtained.
javax.jms.JMSException
public static void setMessageProperties(java.util.HashMap props, javax.jms.Message msg) throws javax.jms.JMSException
props
as the properties
of msg
. Depending on the type of the value found
in props
entries, appropriate setter is called on the
JMS message. For example if the props
has the key-value
pairs as:
{"MyIntProperty", java.lang.Integer(2234)}, {"MyFloatProperty", java.lang.Float(44.99)} then these will be added to msg as: msg.setIntProperty("MyIntProperty", java.lang.Integer(2234).intValue()); msg.setFloatProperty("MyFloatProperty", java.lang.Float(44.99).floatValue());
props
- The HashMap containing the properties to be set.msg
- The JMS message on which the properties are to be set.
javax.jms.JMSException
public static javax.jms.QueueConnection getQueueConnection(java.lang.String qcfName, boolean started) throws javax.naming.NamingException, javax.jms.JMSException
qcfName
- JNDI name of the queue connection factory that will
be used for creating the queue connection.started
- If set to true
then the new connection
is returned after caling start()
on it.
javax.naming.NamingException
javax.jms.JMSException
public static javax.jms.TopicConnection getTopicConnection(java.lang.String tcfName, boolean started) throws javax.naming.NamingException, javax.jms.JMSException
tcfName
- JNDI name of the topic connection factory that will
be used for creating the topic connection.started
- If set to true
then the new connection
is returned after caling start()
on it.
javax.naming.NamingException
javax.jms.JMSException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |