Class Utils
java.lang.Object
org.apache.jmeter.protocol.jms.Utils
Utility methods for JMS protocol.
WARNING - the API for this class is likely to change!
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddJMSProperties(Message msg, Map<String, Object> map) Set JMS Properties to msgstatic voidclose(Connection closeable, Logger log) static voidclose(MessageConsumer closeable, Logger log) static voidclose(MessageProducer closeable, Logger log) static voidclose(Session closeable, Logger log) static final JMSPropertiesConvertsArgumentstoJMSPropertiesdefaulting to String type Used to convert version <= 2.10 test plansstatic ConnectiongetConnection(Context ctx, String factoryName) Obtain the queue connection from the context and factory name.static final StringgetFromEnvironment(Context context, String key) Get value from Context environment taking into account non fully compliant JNDI implementationsstatic DestinationlookupDestination(Context context, String name) Method will lookup a given destination (topic/queue) using JNDI.static StringBuildermessageProperties(StringBuilder sb, Message msg) static StringmessageProperties(Message msg) static StringBuilderrequestHeaders(StringBuilder sb, Message msg)
-
Field Details
-
DEFAULT_PRIORITY_4
- See Also:
-
DEFAULT_NO_EXPIRY
- See Also:
-
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
close
public static void close(MessageConsumer closeable, Logger log) -
close
public static void close(Session closeable, Logger log) -
close
public static void close(Connection closeable, Logger log) -
close
public static void close(MessageProducer closeable, Logger log) -
messageProperties
-
messageProperties
-
requestHeaders
-
lookupDestination
Method will lookup a given destination (topic/queue) using JNDI.- Parameters:
context- context to use for lookupname- the destination name- Returns:
- the destination, never null
- Throws:
NamingException- if the name cannot be found as a Destination
-
getFromEnvironment
Get value from Context environment taking into account non fully compliant JNDI implementations- Parameters:
context- context to usekey- key to lookup in contexts environment- Returns:
- String or
nullif context.getEnvironment() is not compliant - Throws:
NamingException- if a naming problem occurs while getting the environment
-
getConnection
public static Connection getConnection(Context ctx, String factoryName) throws JMSException, NamingException Obtain the queue connection from the context and factory name.- Parameters:
ctx- context to usefactoryName- name of the object factory to look up incontext- Returns:
- the queue connection
-
addJMSProperties
-
convertArgumentsToJmsProperties
ConvertsArgumentstoJMSPropertiesdefaulting to String type Used to convert version <= 2.10 test plans- Parameters:
args-Argumentsto be converted- Returns:
- jmsProperties The converted
JMSProperties
-