|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.axis2.transport.base.BaseUtils org.apache.axis2.transport.jms.JMSUtils
public class JMSUtils
Miscallaneous methods used for the JMS transport
Constructor Summary | |
---|---|
JMSUtils()
|
Method Summary | ||
---|---|---|
static javax.jms.Connection |
createConnection(javax.jms.ConnectionFactory conFac,
java.lang.String user,
java.lang.String pass,
boolean jmsSpec11,
java.lang.Boolean isQueue)
This is a JMS spec independent method to create a Connection. |
|
static javax.jms.MessageConsumer |
createConsumer(javax.jms.Session session,
javax.jms.Destination destination,
java.lang.Boolean isQueue,
java.lang.String subscriberName,
java.lang.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,
java.lang.String messageSelector)
Create a MessageConsumer for the given Destination |
|
static javax.jms.MessageProducer |
createProducer(javax.jms.Session session,
javax.jms.Destination destination,
java.lang.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,
java.lang.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 long |
getBodyLength(javax.jms.BytesMessage bMsg)
Return the body length in bytes for a bytes message |
|
static java.lang.String |
getDestination(java.lang.String url)
Return the destination name from the given URL |
|
static java.lang.String |
getDestinationTypeAsString(int destType)
Return a String representation of the destination type |
|
static long |
getMessageSize(javax.jms.Message message)
Get the length of the message in bytes |
|
static java.lang.String |
getProperty(javax.jms.Message message,
java.lang.String property)
Get a String property from the JMS message |
|
static java.util.Map<java.lang.String,java.lang.Object> |
getTransportHeaders(javax.jms.Message message)
Extract transport level headers for JMS from the given message into a Map |
|
static boolean |
isJMSService(org.apache.axis2.description.AxisService service)
Should this service be enabled over the JMS transport? |
|
static void |
loadTransportHeaders(javax.jms.Message message,
org.apache.axis2.context.MessageContext responseMsgCtx)
Read the transport headers from the JMS Message and set them to the axis2 message context |
|
static
|
lookup(javax.naming.Context context,
java.lang.Class<T> clazz,
java.lang.String name)
|
|
static javax.jms.Destination |
lookupDestination(javax.naming.Context context,
java.lang.String destinationName,
java.lang.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 |
setSOAPEnvelope(javax.jms.Message message,
org.apache.axis2.context.MessageContext msgContext,
java.lang.String contentType)
Set the SOAPEnvelope to the Axis2 MessageContext, from the JMS Message passed in |
|
static void |
setTransportHeaders(org.apache.axis2.context.MessageContext msgContext,
javax.jms.Message message)
Set transport headers from the axis message context, into the JMS message |
Methods inherited from class org.apache.axis2.transport.base.BaseUtils |
---|
getEnvelope, getEPRProperties, getMessageFormatter, getOMOutputFormat, getQNameFromString, handleException, handleException, isBlank, isUsingTransport, loadProperties, markServiceAsFaulty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JMSUtils()
Method Detail |
---|
public static boolean isJMSService(org.apache.axis2.description.AxisService service)
service
- the Axis service
public static java.lang.String getProperty(javax.jms.Message message, java.lang.String property)
message
- JMS messageproperty
- property name
public static java.lang.String getDestination(java.lang.String url)
url
- the URL
public static void setSOAPEnvelope(javax.jms.Message message, org.apache.axis2.context.MessageContext msgContext, java.lang.String contentType) throws org.apache.axis2.AxisFault, javax.jms.JMSException
message
- the JMS message readmsgContext
- the Axis2 MessageContext to be populatedcontentType
- content type for the message
org.apache.axis2.AxisFault
javax.jms.JMSException
public 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 ReplyTo
public static void setTransportHeaders(org.apache.axis2.context.MessageContext msgContext, javax.jms.Message message) throws javax.jms.JMSException
msgContext
- the axis message contextmessage
- the JMS Message
javax.jms.JMSException
- on exceptionpublic static void loadTransportHeaders(javax.jms.Message message, org.apache.axis2.context.MessageContext responseMsgCtx) throws org.apache.axis2.AxisFault
message
- the JMS Message receivedresponseMsgCtx
- the axis message context
org.apache.axis2.AxisFault
- on errorpublic static java.util.Map<java.lang.String,java.lang.Object> getTransportHeaders(javax.jms.Message message)
message
- the JMS message
public static javax.jms.MessageConsumer createConsumer(javax.jms.Session session, javax.jms.Destination dest, java.lang.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 any
javax.jms.JMSException
public static javax.jms.Destination createTemporaryDestination(javax.jms.Session session) throws javax.jms.JMSException
session
- the JMS Session to use
javax.jms.JMSException
public static long getBodyLength(javax.jms.BytesMessage bMsg)
bMsg
- the JMS BytesMessage
public static long getMessageSize(javax.jms.Message message) throws javax.jms.JMSException
message
-
javax.jms.JMSException
public static <T> T lookup(javax.naming.Context context, java.lang.Class<T> clazz, java.lang.String name) throws javax.naming.NamingException
javax.naming.NamingException
public static javax.jms.Connection createConnection(javax.jms.ConnectionFactory conFac, java.lang.String user, java.lang.String pass, boolean jmsSpec11, java.lang.Boolean isQueue) 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?
javax.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, java.lang.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, java.lang.Boolean isQueue, java.lang.String subscriberName, java.lang.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, java.lang.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 java.lang.String getDestinationTypeAsString(int destType)
destType
- the destination type indicator int
public static javax.jms.Destination lookupDestination(javax.naming.Context context, java.lang.String destinationName, java.lang.String destinationType) throws javax.naming.NamingException
context
- the Context to lookupdestinationName
- name of the destination to be looked updestinationType
- type of the destination to be looked up
javax.naming.NamingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |