org.apache.axis2.transport.jms
Class JMSMessageSender

java.lang.Object
  extended by org.apache.axis2.transport.jms.JMSMessageSender

public class JMSMessageSender
extends java.lang.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
JMSMessageSender(javax.jms.Connection connection, javax.jms.Session session, javax.jms.MessageProducer producer, javax.jms.Destination destination, int cacheLevel, boolean jmsSpec11, java.lang.Boolean isQueue)
          This is a low-end method to support the one-time sends using JMS 1.0.2b
JMSMessageSender(JMSConnectionFactory jmsConnectionFactory, java.lang.String targetAddress)
          Create a JMSSender using a JMSConnectionFactory and target EPR
 
Method Summary
 void close()
          Close non-shared producer, session and connection if any
 int getCacheLevel()
           
 javax.jms.Connection getConnection()
           
 javax.jms.MessageProducer getProducer()
           
 javax.jms.Session getSession()
           
 void send(javax.jms.Message message, org.apache.axis2.context.MessageContext msgCtx)
          Perform actual send of JMS message to the Destination selected
 void setCacheLevel(int cacheLevel)
           
 void setConnection(javax.jms.Connection connection)
           
 void setProducer(javax.jms.MessageProducer producer)
           
 void setSession(javax.jms.Session session)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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,
                        java.lang.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,
                        java.lang.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,
                 org.apache.axis2.context.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()


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.