public final class Utils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_NO_EXPIRY |
static java.lang.String |
DEFAULT_PRIORITY_4 |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static void |
addJMSProperties(javax.jms.Message msg,
java.util.Map<java.lang.String,java.lang.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(javax.naming.Context ctx,
java.lang.String factoryName)
Obtain the queue connection from the context and factory name.
|
static java.lang.String |
getFromEnvironment(javax.naming.Context context,
java.lang.String key)
Get value from Context environment taking into account non fully
compliant JNDI implementations
|
static javax.jms.Destination |
lookupDestination(javax.naming.Context context,
java.lang.String name)
Method will lookup a given destination (topic/queue) using JNDI.
|
static java.lang.String |
messageProperties(javax.jms.Message msg) |
static java.lang.StringBuilder |
messageProperties(java.lang.StringBuilder sb,
javax.jms.Message msg) |
static java.lang.StringBuilder |
requestHeaders(java.lang.StringBuilder sb,
javax.jms.Message msg) |
public static final java.lang.String DEFAULT_PRIORITY_4
public static final java.lang.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
- MessageProducer
log
- Logger
public static java.lang.String messageProperties(javax.jms.Message msg)
public static java.lang.StringBuilder messageProperties(java.lang.StringBuilder sb, javax.jms.Message msg)
public static java.lang.StringBuilder requestHeaders(java.lang.StringBuilder sb, javax.jms.Message msg)
public static javax.jms.Destination lookupDestination(javax.naming.Context context, java.lang.String name) throws javax.naming.NamingException
context
- context to use for lookupname
- the destination namejavax.naming.NamingException
- if the name cannot be found as a Destinationpublic static java.lang.String getFromEnvironment(javax.naming.Context context, java.lang.String key) throws javax.naming.NamingException
context
- context to usekey
- key to lookup in contexts environmentnull
if context.getEnvironment() is not compliantjavax.naming.NamingException
- if a naming problem occurs while getting the environmentpublic static javax.jms.Connection getConnection(javax.naming.Context ctx, java.lang.String factoryName) throws javax.jms.JMSException, javax.naming.NamingException
ctx
- context to usefactoryName
- name of the object factory to look up in context
javax.jms.JMSException
- when creation of the connection failsjavax.naming.NamingException
- when lookup in context failspublic static void addJMSProperties(javax.jms.Message msg, java.util.Map<java.lang.String,java.lang.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 convertedJMSProperties
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.