Package org.objectweb.joram.client.jms
Class QueueSender
- java.lang.Object
-
- org.objectweb.joram.client.jms.MessageProducer
-
- org.objectweb.joram.client.jms.QueueSender
-
- All Implemented Interfaces:
AutoCloseable,MessageProducer,QueueSender
public class QueueSender extends MessageProducer implements QueueSender
Implements thejavax.jms.QueueSenderinterface.
-
-
Field Summary
-
Fields inherited from class org.objectweb.joram.client.jms.MessageProducer
closed, dest, sess
-
-
Constructor Summary
Constructors Constructor Description QueueSender(QueueSession sess, Destination queue)Constructs a sender.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueuegetQueue()API method.voidsend(Queue queue, Message message)API method.voidsend(Queue queue, Message message, int deliveryMode, int priority, long timeToLive)API method.StringtoString()Returns a string view of this receiver.-
Methods inherited from class org.objectweb.joram.client.jms.MessageProducer
close, getDeliveryDelay, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, send, send, send, send, setDeliveryDelay, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.jms.MessageProducer
close, getDeliveryDelay, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, send, send, setDeliveryDelay, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
-
Methods inherited from interface javax.jms.QueueSender
send, send
-
-
-
-
Constructor Detail
-
QueueSender
QueueSender(QueueSession sess, Destination queue) throws JMSException
Constructs a sender.- Parameters:
sess- The session the sender belongs to.queue- The queue the sender sends messages to.- Throws:
IllegalStateException- If the connection is broken.JMSException- If the creation fails for any other reason.
-
-
Method Detail
-
toString
public String toString()
Returns a string view of this receiver.
-
getQueue
public Queue getQueue() throws JMSException
API method. Gets the queue associated with this queue sender.- Specified by:
getQueuein interfaceQueueSender- Returns:
- this sender's Queue.
- Throws:
IllegalStateException- If the sender is closed.JMSException
-
send
public void send(Queue queue, Message message) throws JMSException
API method. Sends a message to a queue for an unidentified queue sender with default delivery parameters.Typically, a queue sender is assigned a queue at creation time; however, the JMS API also supports unidentified queue sender, which require that the queue be supplied every time a message is sent.
- Specified by:
sendin interfaceQueueSender- Parameters:
queue- the queue to send this message to.message- the message to send.- Throws:
UnsupportedOperationException- When the sender did not properly identify itself.JMSSecurityException- If the user if not a WRITER on the specified queue.IllegalStateException- If the sender is closed, or if the connection is broken.JMSException- If the request fails for any other reason.
-
send
public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
API method. Sends a message to a queue for an unidentified queue sender with given delivery parameters.Typically, a queue sender is assigned a queue at creation time; however, the JMS API also supports unidentified queue sender, which require that the queue be supplied every time a message is sent.
- Specified by:
sendin interfaceQueueSender- Parameters:
queue- the queue to send this message to.message- the message to send.deliveryMode- the delivery mode to use.priority- the priority for this message.timeToLive- the message's lifetime in milliseconds.- Throws:
UnsupportedOperationException- When the sender did not properly identify itself.JMSSecurityException- If the user if not a WRITER on the specified queue.IllegalStateException- If the sender is closed, or if the connection is broken.JMSException- If the request fails for any other reason.
-
-