Class 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 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 Connection
        session - JMS Session
        producer - the MessageProducer
        destination - the JMS Destination
        cacheLevel - cacheLevel - None | Connection | Session | Producer
        jmsSpec11 - true if the JMS 1.1 API should be used
        isQueue - posting to a Queue?
      • JMSMessageSender

        public JMSMessageSender​(JMSConnectionFactory jmsConnectionFactory,
                                String targetAddress)
        Create a JMSSender using a JMSConnectionFactory and target EPR
        Parameters:
        jmsConnectionFactory - the JMSConnectionFactory
        targetAddress - 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 message
        msgCtx - 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()