Package org.apache.axis2.transport.jms
Class JMSMessageSender
- java.lang.Object
-
- org.apache.axis2.transport.jms.JMSMessageSender
-
public class JMSMessageSender extends Object
Performs the actual sending of a JMS message, and the subsequent committing of a JTA transaction (if requested) or the local session transaction, if used. An instance of this class is unique to a single message send out operation and will not be shared.
-
-
Constructor Summary
Constructors Constructor Description JMSMessageSender(javax.jms.Connection connection, javax.jms.Session session, javax.jms.MessageProducer producer, javax.jms.Destination destination, int cacheLevel, boolean jmsSpec11, Boolean isQueue)This is a low-end method to support the one-time sends using JMS 1.0.2bJMSMessageSender(JMSConnectionFactory jmsConnectionFactory, String targetAddress)Create a JMSSender using a JMSConnectionFactory and target EPR
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close non-shared producer, session and connection if anyintgetCacheLevel()javax.jms.ConnectiongetConnection()javax.jms.MessageProducergetProducer()javax.jms.SessiongetSession()voidsend(javax.jms.Message message, MessageContext msgCtx)Perform actual send of JMS message to the Destination selectedvoidsetCacheLevel(int cacheLevel)voidsetConnection(javax.jms.Connection connection)voidsetProducer(javax.jms.MessageProducer producer)voidsetSession(javax.jms.Session session)
-
-
-
Constructor Detail
-
JMSMessageSender
public JMSMessageSender(javax.jms.Connection connection, javax.jms.Session session, javax.jms.MessageProducer producer, javax.jms.Destination destination, int cacheLevel, boolean jmsSpec11, Boolean isQueue)This is a low-end method to support the one-time sends using JMS 1.0.2b- Parameters:
connection- the JMS Connectionsession- JMS Sessionproducer- the MessageProducerdestination- the JMS DestinationcacheLevel- cacheLevel - None | Connection | Session | ProducerjmsSpec11- true if the JMS 1.1 API should be usedisQueue- posting to a Queue?
-
JMSMessageSender
public JMSMessageSender(JMSConnectionFactory jmsConnectionFactory, String targetAddress)
Create a JMSSender using a JMSConnectionFactory and target EPR- Parameters:
jmsConnectionFactory- the JMSConnectionFactorytargetAddress- target EPR
-
-
Method Detail
-
send
public void send(javax.jms.Message message, MessageContext msgCtx)Perform actual send of JMS message to the Destination selected- Parameters:
message- the JMS messagemsgCtx- the Axis2 MessageContext
-
close
public void close()
Close non-shared producer, session and connection if any
-
setConnection
public void setConnection(javax.jms.Connection connection)
-
setSession
public void setSession(javax.jms.Session session)
-
setProducer
public void setProducer(javax.jms.MessageProducer producer)
-
setCacheLevel
public void setCacheLevel(int cacheLevel)
-
getCacheLevel
public int getCacheLevel()
-
getConnection
public javax.jms.Connection getConnection()
-
getProducer
public javax.jms.MessageProducer getProducer()
-
getSession
public javax.jms.Session getSession()
-
-