Apache JMeter

org.apache.jmeter.protocol.jms
Class Utils

java.lang.Object
  extended by org.apache.jmeter.protocol.jms.Utils

public final class Utils
extends Object

Utility methods for JMS protocol. WARNING - the API for this class is likely to change!


Field Summary
static String DEFAULT_NO_EXPIRY
           
static String DEFAULT_PRIORITY_4
           
 
Constructor Summary
Utils()
           
 
Method Summary
static void addJMSProperties(javax.jms.Message msg, Map<String,Object> map)
          Set JMS Properties to msg
static void close(javax.jms.Connection closeable, org.apache.log.Logger log)
           
static void close(javax.jms.MessageConsumer closeable, org.apache.log.Logger log)
           
static void close(javax.jms.MessageProducer closeable, org.apache.log.Logger log)
           
static void close(javax.jms.Session closeable, org.apache.log.Logger log)
           
static JMSProperties convertArgumentsToJmsProperties(Arguments args)
          Converts Arguments to JMSProperties defaulting to String type Used to convert version <= 2.10 test plans
static javax.jms.Connection getConnection(Context ctx, String factoryName)
          Obtain the queue connection from the context and factory name.
static String getFromEnvironment(Context context, String key)
          Get value from Context environment taking into account non fully compliant JNDI implementations
static javax.jms.Destination lookupDestination(Context context, String name)
          Method will lookup a given destination (topic/queue) using JNDI.
static String messageProperties(javax.jms.Message msg)
           
static StringBuilder messageProperties(StringBuilder sb, javax.jms.Message msg)
           
static StringBuilder requestHeaders(StringBuilder sb, javax.jms.Message msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PRIORITY_4

public static final String DEFAULT_PRIORITY_4
See Also:
Constant Field Values

DEFAULT_NO_EXPIRY

public static final String DEFAULT_NO_EXPIRY
See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

close

public static void close(javax.jms.MessageConsumer closeable,
                         org.apache.log.Logger log)

close

public static void close(javax.jms.Session closeable,
                         org.apache.log.Logger log)

close

public static void close(javax.jms.Connection closeable,
                         org.apache.log.Logger log)

close

public static void close(javax.jms.MessageProducer closeable,
                         org.apache.log.Logger log)

messageProperties

public static String messageProperties(javax.jms.Message msg)

messageProperties

public static StringBuilder messageProperties(StringBuilder sb,
                                              javax.jms.Message msg)

requestHeaders

public static StringBuilder requestHeaders(StringBuilder sb,
                                           javax.jms.Message msg)

lookupDestination

public static javax.jms.Destination lookupDestination(Context context,
                                                      String name)
                                               throws NamingException
Method will lookup a given destination (topic/queue) using JNDI.

Parameters:
context -
name - the destination name
Returns:
the destination, never null
Throws:
NamingException - if the name cannot be found as a Destination

getFromEnvironment

public static final String getFromEnvironment(Context context,
                                              String key)
                                       throws NamingException
Get value from Context environment taking into account non fully compliant JNDI implementations

Parameters:
context -
key -
Returns:
String or null if context.getEnvironment() is not compliant
Throws:
NamingException

getConnection

public static javax.jms.Connection getConnection(Context ctx,
                                                 String factoryName)
                                          throws javax.jms.JMSException,
                                                 NamingException
Obtain the queue connection from the context and factory name.

Parameters:
ctx -
factoryName -
Returns:
the queue connection
Throws:
javax.jms.JMSException
NamingException

addJMSProperties

public static void addJMSProperties(javax.jms.Message msg,
                                    Map<String,Object> map)
                             throws javax.jms.JMSException
Set JMS Properties to msg

Parameters:
msg - Message
map - Map
Throws:
javax.jms.JMSException

convertArgumentsToJmsProperties

public static final JMSProperties convertArgumentsToJmsProperties(Arguments args)
Converts Arguments to JMSProperties defaulting to String type Used to convert version <= 2.10 test plans

Parameters:
args - Arguments
Returns:
jmsProperties JMSProperties

Apache JMeter

Copyright © 1998-2014 Apache Software Foundation. All Rights Reserved.