com.atomikos.jms
Class QueueSenderSession

java.lang.Object
  extended by com.atomikos.jms.MessageProducerSession
      extended by com.atomikos.jms.QueueSenderSession

public class QueueSenderSession
extends MessageProducerSession

This is a long-lived queue sender session, representing a self-refreshing JMS session that can be used to send JMS messages in a transactional way. The client code does not have to worry about refreshing or closing JMS objects explicitly: this is all handled in this class. All the client needs to do is indicate when it wants to start or stop using the session.

Note that instances are not meant for concurrent use by different threads: each thread should use a private instance instead.

Important: if you change any properties AFTER sending on the session, then you will need to explicitly stop and restart the session to have the changes take effect!


Constructor Summary
QueueSenderSession()
          Default constructor in JavaBean style.
 
Method Summary
protected  String getDestinationName()
           
 javax.jms.Queue getQueue()
           
 QueueConnectionFactoryBean getQueueConnectionFactoryBean()
           
protected  String getReplyToDestinationName()
           
 javax.jms.Queue getReplyToQueue()
          Gets the queue where replies are expected, or null if not applicable (or if the replyToDestination is not a queue but a topic).
 void setQueue(javax.jms.Queue queue)
          Set the queue to use for sending (required).
 void setQueueConnectionFactoryBean(QueueConnectionFactoryBean bean)
          Set the queue connection factory, needed to create or refresh connections (required).
 void setReplyToQueue(javax.jms.Queue queue)
          If this session is used for sending request/reply messages, then this property indicates the queue to where the replies are to be sent (optional).
 
Methods inherited from class com.atomikos.jms.MessageProducerSession
createBytesMessage, createMapMessage, createObjectMessage, createStreamMessage, createTextMessage, getAbstractConnectionFactoryBean, getDeliveryMode, getDestination, getPriority, getReplyToDestination, getTimeToLive, getUser, init, sendMessage, setAbstractConnectionFactoryBean, setDeliveryMode, setDestination, setPassword, setPriority, setReplyToDestination, setTimeToLive, setUser, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueSenderSession

public QueueSenderSession()
Default constructor in JavaBean style. Needed to ensure compatibility with third-party frameworks such as Spring.

Method Detail

setReplyToQueue

public void setReplyToQueue(javax.jms.Queue queue)
If this session is used for sending request/reply messages, then this property indicates the queue to where the replies are to be sent (optional). The session uses this to set the JMSReplyTo header accordingly. This property can be omitted if no reply is needed.

The replyToQueue should be in the same JMS vendor domain as the send queue. To cross domains, configure a bridge for both the request and the reply channels.

Parameters:
queue - The queue where a reply should go.

getReplyToQueue

public javax.jms.Queue getReplyToQueue()
Gets the queue where replies are expected, or null if not applicable (or if the replyToDestination is not a queue but a topic).

Returns:

getQueue

public javax.jms.Queue getQueue()
Returns:
The queue to send to.

getQueueConnectionFactoryBean

public QueueConnectionFactoryBean getQueueConnectionFactoryBean()
Returns:
The queue connection factory bean.

setQueue

public void setQueue(javax.jms.Queue queue)
Set the queue to use for sending (required).

Parameters:
queue - The queue.

setQueueConnectionFactoryBean

public void setQueueConnectionFactoryBean(QueueConnectionFactoryBean bean)
Set the queue connection factory, needed to create or refresh connections (required).

Parameters:
bean -

getDestinationName

protected String getDestinationName()
Specified by:
getDestinationName in class MessageProducerSession

getReplyToDestinationName

protected String getReplyToDestinationName()
Specified by:
getReplyToDestinationName in class MessageProducerSession


Copyright © 2011. All Rights Reserved.