Package org.apache.jmeter.protocol.jms
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 SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidaddJMSProperties(javax.jms.Message msg, Map<String, Object> map) Set JMS Properties to msgstatic voidclose(javax.jms.Connection closeable, org.slf4j.Logger log) static voidclose(javax.jms.MessageConsumer closeable, org.slf4j.Logger log) static voidclose(javax.jms.MessageProducer closeable, org.slf4j.Logger log) static voidclose(javax.jms.Session closeable, org.slf4j.Logger log) static JMSPropertiesConvertsArgumentstoJMSPropertiesdefaulting to String type Used to convert version <= 2.10 test plansstatic javax.jms.ConnectiongetConnection(Context ctx, String factoryName) Obtain the queue connection from the context and factory name.static StringgetFromEnvironment(Context context, String key) Get value from Context environment taking into account non fully compliant JNDI implementationsstatic javax.jms.DestinationlookupDestination(Context context, String name) Method will lookup a given destination (topic/queue) using JNDI.static StringBuildermessageProperties(StringBuilder sb, javax.jms.Message msg) static StringmessageProperties(javax.jms.Message msg) static StringBuilderrequestHeaders(StringBuilder sb, javax.jms.Message msg) 
- 
Field Details- 
DEFAULT_PRIORITY_4- See Also:
 
- 
DEFAULT_NO_EXPIRY- See Also:
 
 
- 
- 
Constructor Details- 
Utilspublic Utils()
 
- 
- 
Method Details- 
closepublic static void close(javax.jms.MessageConsumer closeable, org.slf4j.Logger log) 
- 
closepublic static void close(javax.jms.Session closeable, org.slf4j.Logger log) 
- 
closepublic static void close(javax.jms.Connection closeable, org.slf4j.Logger log) 
- 
closepublic static void close(javax.jms.MessageProducer closeable, org.slf4j.Logger log) - Parameters:
- closeable-- MessageProducer
- log-- Logger
 
- 
messageProperties
- 
messageProperties
- 
requestHeaders
- 
lookupDestinationpublic static javax.jms.Destination lookupDestination(Context context, String name) throws NamingException Method will lookup a given destination (topic/queue) using JNDI.- Parameters:
- context- context to use for lookup
- name- the destination name
- Returns:
- the destination, never null
- Throws:
- NamingException- if the name cannot be found as a Destination
 
- 
getFromEnvironmentGet value from Context environment taking into account non fully compliant JNDI implementations- Parameters:
- context- context to use
- key- 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
 
- 
getConnectionpublic 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- context to use
- factoryName- name of the object factory to look up in- context
- Returns:
- the queue connection
- Throws:
- javax.jms.JMSException- when creation of the connection fails
- NamingException- when lookup in context fails
 
- 
addJMSPropertiespublic static void addJMSProperties(javax.jms.Message msg, Map<String, Object> map) throws javax.jms.JMSExceptionSet JMS Properties to msg- Parameters:
- msg- Message to operate on
- map- Map of Properties to be set on the message
- Throws:
- javax.jms.JMSException- when- msgthrows a- JMSExceptionwhile the properties get set
 
- 
convertArgumentsToJmsPropertiesConvertsArgumentstoJMSPropertiesdefaulting to String type Used to convert version <= 2.10 test plans- Parameters:
- args-- Argumentsto be converted
- Returns:
- jmsProperties The converted JMSProperties
 
 
-