org.yajul.jms
Class JmsHelper

java.lang.Object
  extended by org.yajul.jms.JmsHelper

public class JmsHelper
extends java.lang.Object

Utility methods for JMS.
User: Joshua Davis Date: Sep 9, 2007 Time: 10:41:52 AM


Constructor Summary
JmsHelper()
           
 
Method Summary
static void close(javax.jms.MessageConsumer consumer, javax.jms.Session session, javax.jms.Connection conn)
          Clean up JMS consumer objects.
static void close(javax.jms.MessageProducer sender, javax.jms.Session session, javax.jms.Connection conn)
          Clean up JMS producer objects.
static java.lang.Long getNullableLongProperty(javax.jms.Message m, java.lang.String property)
           
static java.lang.Object getObject(javax.jms.Message message)
          Returns the object in the JMS message if it's an object message.
static java.lang.String getStringProperty(javax.jms.Message m, java.lang.String property)
           
static boolean messagePropertyNullOrEqualTo(javax.jms.Message message, java.lang.String propertyName, java.lang.Long aLong)
           
static javax.jms.Message peek(javax.jms.Session session, javax.jms.Destination destination)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsHelper

public JmsHelper()
Method Detail

close

public static void close(javax.jms.MessageProducer sender,
                         javax.jms.Session session,
                         javax.jms.Connection conn)
Clean up JMS producer objects. Typically used in a finally block.

Parameters:
sender - the sender
session - the session (may be null)
conn - the connection (may be null)

close

public static void close(javax.jms.MessageConsumer consumer,
                         javax.jms.Session session,
                         javax.jms.Connection conn)
Clean up JMS consumer objects. Typically used in a finally block.

Parameters:
consumer - the consumer
session - the session (may be null)
conn - the connection (may be null)

getObject

public static java.lang.Object getObject(javax.jms.Message message)
Returns the object in the JMS message if it's an object message.

Parameters:
message - the JMS message
Returns:
the object in the JMS message if it's an object message, null otherwise.

getNullableLongProperty

public static java.lang.Long getNullableLongProperty(javax.jms.Message m,
                                                     java.lang.String property)
                                              throws javax.jms.JMSException
Throws:
javax.jms.JMSException

getStringProperty

public static java.lang.String getStringProperty(javax.jms.Message m,
                                                 java.lang.String property)
                                          throws javax.jms.JMSException
Throws:
javax.jms.JMSException

peek

public static javax.jms.Message peek(javax.jms.Session session,
                                     javax.jms.Destination destination)
                              throws javax.jms.JMSException
Throws:
javax.jms.JMSException

messagePropertyNullOrEqualTo

public static boolean messagePropertyNullOrEqualTo(javax.jms.Message message,
                                                   java.lang.String propertyName,
                                                   java.lang.Long aLong)


Copyright © 2008. All Rights Reserved.