public class JMSUtils
extends org.apache.axis2.transport.base.BaseUtils
| Constructor and Description |
|---|
JMSUtils() |
| Modifier and Type | Method and Description |
|---|---|
static javax.jms.Connection |
createConnection(javax.jms.ConnectionFactory conFac,
String user,
String pass,
boolean jmsSpec11,
Boolean isQueue,
boolean isDurable,
String clientID)
This is a JMS spec independent method to create a Connection.
|
static javax.jms.MessageConsumer |
createConsumer(javax.jms.Session session,
javax.jms.Destination destination,
Boolean isQueue,
String subscriberName,
String messageSelector,
boolean pubSubNoLocal,
boolean isDurable,
boolean jmsSpec11)
This is a JMS spec independent method to create a MessageConsumer.
|
static javax.jms.MessageConsumer |
createConsumer(javax.jms.Session session,
javax.jms.Destination dest,
String messageSelector)
Create a MessageConsumer for the given Destination
|
static javax.jms.MessageProducer |
createProducer(javax.jms.Session session,
javax.jms.Destination destination,
Boolean isQueue,
boolean jmsSpec11)
This is a JMS spec independent method to create a MessageProducer.
|
static javax.jms.Session |
createSession(javax.jms.Connection connection,
boolean transacted,
int ackMode,
boolean jmsSpec11,
Boolean isQueue)
This is a JMS spec independent method to create a Session.
|
static javax.jms.Destination |
createTemporaryDestination(javax.jms.Session session)
Create a temp queue or topic for synchronous receipt of responses, when a reply destination
is not specified
|
static String |
getDestinationTypeAsString(int destType)
Return a String representation of the destination type
|
static String |
getProperty(javax.jms.Message message,
String property)
Get a String property from the JMS message
|
static Map<String,Object> |
getTransportHeaders(javax.jms.Message message)
Extract transport level headers for JMS from the given message into a Map
|
static <T> T |
lookup(Context context,
Class<T> clazz,
String name) |
static javax.jms.Destination |
lookupDestination(Context context,
String destinationName,
String destinationType)
Return the JMS destination with the given destination name looked up from the context
|
static javax.jms.Destination |
setReplyDestination(javax.jms.Destination replyDestination,
javax.jms.Session session,
javax.jms.Message message)
Set the JMS ReplyTo for the message
|
static void |
setTransportHeaders(Map<String,String> messageConfiguration,
javax.jms.Message message)
Set transport headers from the axis message context, into the JMS message
|
public static String getProperty(javax.jms.Message message, String property)
message - JMS messageproperty - property namepublic static javax.jms.Destination setReplyDestination(javax.jms.Destination replyDestination,
javax.jms.Session session,
javax.jms.Message message)
replyDestination - the JMS Destination where the reply is expectedsession - the session to use to create a temp Queue if a response is expected
but a Destination has not been specifiedmessage - the JMS message where the final Destinatio would be set as the JMS ReplyTopublic static void setTransportHeaders(Map<String,String> messageConfiguration, javax.jms.Message message) throws javax.jms.JMSException
messageConfiguration - the adaptor message contextmessage - the JMS Messagejavax.jms.JMSException - on exceptionpublic static Map<String,Object> getTransportHeaders(javax.jms.Message message)
message - the JMS messagepublic static javax.jms.MessageConsumer createConsumer(javax.jms.Session session,
javax.jms.Destination dest,
String messageSelector)
throws javax.jms.JMSException
session - JMS Session to usedest - Destination for which the Consumer is to be createdmessageSelector - the message selector to be used if anyjavax.jms.JMSExceptionpublic static javax.jms.Destination createTemporaryDestination(javax.jms.Session session)
throws javax.jms.JMSException
session - the JMS Session to usejavax.jms.JMSExceptionpublic static <T> T lookup(Context context, Class<T> clazz, String name) throws NamingException
NamingExceptionpublic static javax.jms.Connection createConnection(javax.jms.ConnectionFactory conFac,
String user,
String pass,
boolean jmsSpec11,
Boolean isQueue,
boolean isDurable,
String clientID)
throws javax.jms.JMSException
conFac - the ConnectionFactory to useuser - optional user namepass - optional passwordjmsSpec11 - should we use JMS 1.1 API ?isQueue - is this to deal with a Queue?isDurable - whether the messaging provider is durableclientID - durable subscriber client idjavax.jms.JMSException - on errors, to be handled and logged by the callerpublic static javax.jms.Session createSession(javax.jms.Connection connection,
boolean transacted,
int ackMode,
boolean jmsSpec11,
Boolean isQueue)
throws javax.jms.JMSException
connection - the JMS Connectiontransacted - should the session be transacted?ackMode - the ACK mode for the sessionjmsSpec11 - should we use the JMS 1.1 API?isQueue - is this Session to deal with a Queue?javax.jms.JMSException - on errors, to be handled and logged by the callerpublic static javax.jms.MessageConsumer createConsumer(javax.jms.Session session,
javax.jms.Destination destination,
Boolean isQueue,
String subscriberName,
String messageSelector,
boolean pubSubNoLocal,
boolean isDurable,
boolean jmsSpec11)
throws javax.jms.JMSException
session - JMS sessiondestination - the DestinationisQueue - is the Destination a queue?subscriberName - optional client name to use for a durable subscription to a topicmessageSelector - optional message selectorpubSubNoLocal - should we receive messages sent by us during pub-sub?isDurable - is this a durable topic subscription?jmsSpec11 - should we use JMS 1.1 API ?javax.jms.JMSException - on errors, to be handled and logged by the callerpublic static javax.jms.MessageProducer createProducer(javax.jms.Session session,
javax.jms.Destination destination,
Boolean isQueue,
boolean jmsSpec11)
throws javax.jms.JMSException
session - JMS sessiondestination - the DestinationisQueue - is the Destination a queue?jmsSpec11 - should we use JMS 1.1 API ?javax.jms.JMSException - on errors, to be handled and logged by the callerpublic static String getDestinationTypeAsString(int destType)
destType - the destination type indicator intpublic static javax.jms.Destination lookupDestination(Context context, String destinationName, String destinationType) throws NamingException
context - the Context to lookupdestinationName - name of the destination to be looked updestinationType - type of the destination to be looked upNamingExceptionCopyright © 2015 WSO2. All rights reserved.