public final class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NO_EXPIRY |
static String |
DEFAULT_PRIORITY_4 |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addJMSProperties(javax.jms.Message msg,
Map<String,Object> map)
Set JMS Properties to msg
|
static void |
close(javax.jms.Connection closeable,
org.slf4j.Logger log) |
static void |
close(javax.jms.MessageConsumer closeable,
org.slf4j.Logger log) |
static void |
close(javax.jms.MessageProducer closeable,
org.slf4j.Logger log) |
static void |
close(javax.jms.Session closeable,
org.slf4j.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) |
public static final String DEFAULT_PRIORITY_4
public static final String DEFAULT_NO_EXPIRY
public static void close(javax.jms.MessageConsumer closeable,
org.slf4j.Logger log)
public static void close(javax.jms.Session closeable,
org.slf4j.Logger log)
public static void close(javax.jms.Connection closeable,
org.slf4j.Logger log)
public static void close(javax.jms.MessageProducer closeable,
org.slf4j.Logger log)
closeable - MessageProducerlog - Loggerpublic static String messageProperties(javax.jms.Message msg)
public static StringBuilder messageProperties(StringBuilder sb, javax.jms.Message msg)
public static StringBuilder requestHeaders(StringBuilder sb, javax.jms.Message msg)
public static javax.jms.Destination lookupDestination(Context context, String name) throws NamingException
context - context to use for lookupname - the destination nameNamingException - if the name cannot be found as a Destinationpublic static String getFromEnvironment(Context context, String key) throws NamingException
context - context to usekey - key to lookup in contexts environmentnull if context.getEnvironment() is not compliantNamingException - if a naming problem occurs while getting the environmentpublic static javax.jms.Connection getConnection(Context ctx, String factoryName) throws javax.jms.JMSException, NamingException
ctx - context to usefactoryName - name of the object factory to look up in contextjavax.jms.JMSException - when creation of the connection failsNamingException - when lookup in context failspublic static void addJMSProperties(javax.jms.Message msg,
Map<String,Object> map)
throws javax.jms.JMSException
msg - Message to operate onmap - Map of Properties to be set on the messagejavax.jms.JMSException - when msg throws a JMSException while the properties get setpublic static JMSProperties convertArgumentsToJmsProperties(Arguments args)
Arguments to JMSProperties defaulting to String type
Used to convert version <= 2.10 test plansargs - Arguments to be convertedJMSPropertiesCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.