Class JMSUtils
- java.lang.Object
-
- org.wso2.carbon.inbound.endpoint.protocol.jms.JMSUtils
-
public class JMSUtils extends Object
Maintain the common methods used by inbound JMS protocol
-
-
Constructor Summary
Constructors Constructor Description JMSUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
convertXMLtoJMSMap(org.apache.axiom.om.OMElement element, javax.jms.MapMessage message)
static Map<String,Object>
getTransportHeaders(javax.jms.Message message, org.apache.axis2.context.MessageContext msgContext)
Extract transport level headers from JMS message into a Mapprotected static void
handleException(String s)
static String
inferJMSMessageType(javax.jms.Message msg)
Method to infer the JMS message type.static javax.jms.Destination
lookupDestination(Context context, String destinationName, String destinationType)
Return the JMS destination with the given destination name looked up from the contextstatic void
setTransportHeaders(org.apache.axis2.context.MessageContext msgContext, javax.jms.Message message)
Set transport headers from the axis message context, into the JMS message
-
-
-
Method Detail
-
inferJMSMessageType
public static String inferJMSMessageType(javax.jms.Message msg)
Method to infer the JMS message type.- Parameters:
msg
- the message to be inferred- Returns:
- the type of the JMS message
-
convertXMLtoJMSMap
public static void convertXMLtoJMSMap(org.apache.axiom.om.OMElement element, javax.jms.MapMessage message) throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
-
setTransportHeaders
public static void setTransportHeaders(org.apache.axis2.context.MessageContext msgContext, javax.jms.Message message) throws javax.jms.JMSException
Set transport headers from the axis message context, into the JMS message- Parameters:
msgContext
- the axis message contextmessage
- the JMS Message- Throws:
javax.jms.JMSException
- on exception
-
lookupDestination
public static javax.jms.Destination lookupDestination(Context context, String destinationName, String destinationType) throws NamingException
Return the JMS destination with the given destination name looked up from the context- Parameters:
context
- the Context to lookupdestinationName
- name of the destination to be looked updestinationType
- type of the destination to be looked up- Returns:
- the JMS destination, or null if it does not exist
- Throws:
NamingException
-
handleException
protected static void handleException(String s) throws NamingException
- Throws:
NamingException
-
getTransportHeaders
public static Map<String,Object> getTransportHeaders(javax.jms.Message message, org.apache.axis2.context.MessageContext msgContext)
Extract transport level headers from JMS message into a Map- Parameters:
message
- JMS messagemsgContext
- axis2 message context- Returns:
- a Map of the transport headers
-
-