JMS 1.0.2

javax.jms
Interface QueueSession


public interface QueueSession
extends Session

A QueueSession provides methods for creating QueueReceiver's, QueueSender's, QueueBrowser's and TemporaryQueues.

If there are messages that have been received but not acknowledged when a QueueSession terminates, these messages will be retained and redelivered when a consumer next accesses the queue.

Version:
1.0 - 14 May 1998
Author:
Mark Hapner, Rich Burridge
See Also:
Session, QueueConnection.createQueueSession(boolean, int), XAQueueSession.getQueueSession()

Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
 
Method Summary
 QueueBrowser createBrowser(Queue queue)
          Create a QueueBrowser to peek at the messages on the specified queue.
 QueueBrowser createBrowser(Queue queue, java.lang.String messageSelector)
          Create a QueueBrowser to peek at the messages on the specified queue.
 Queue createQueue(java.lang.String queueName)
          Create a queue identity given a Queue name.
 QueueReceiver createReceiver(Queue queue)
          Create a QueueReceiver to receive messages from the specified queue.
 QueueReceiver createReceiver(Queue queue, java.lang.String messageSelector)
          Create a QueueReceiver to receive messages from the specified queue.
 QueueSender createSender(Queue queue)
          Create a QueueSender to send messages to the specified queue.
 TemporaryQueue createTemporaryQueue()
          Create a temporary queue.
 
Methods inherited from interface javax.jms.Session
close, commit, createBytesMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, getMessageListener, getTransacted, recover, rollback, run, setMessageListener
 

Method Detail

createQueue

public Queue createQueue(java.lang.String queueName)
                  throws JMSException
Create a queue identity given a Queue name.

This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. This allows the creation of a queue identity with a provider specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical topic. The physical creation of topics is an administration task and not to be initiated by the JMS interface. The one exception is the creation of temporary topics is done using the createTemporaryTopic method.

Parameters:
queueName - the name of this queue
Returns:
a Queue with the given name.
Throws:
JMSException - if a session fails to create a queue due to some JMS error.

createReceiver

public QueueReceiver createReceiver(Queue queue)
                             throws JMSException
Create a QueueReceiver to receive messages from the specified queue.
Parameters:
queue - the queue to access
Throws:
JMSException - if a session fails to create a receiver due to some JMS error.
InvalidDestinationException - if invalid Queue specified.

createReceiver

public QueueReceiver createReceiver(Queue queue,
                                    java.lang.String messageSelector)
                             throws JMSException
Create a QueueReceiver to receive messages from the specified queue.
Parameters:
queue - the queue to access
messageSelector - only messages with properties matching the message selector expression are delivered
Throws:
JMSException - if a session fails to create a receiver due to some JMS error.
InvalidDestinationException - if invalid Queue specified.
InvalidSelectorException - if the message selector is invalid.

createSender

public QueueSender createSender(Queue queue)
                         throws JMSException
Create a QueueSender to send messages to the specified queue.
Parameters:
queue - the queue to access, or null if this is an unidentifed producer.
Throws:
JMSException - if a session fails to create a sender due to some JMS error.
InvalidDestinationException - if invalid Queue specified.

createBrowser

public QueueBrowser createBrowser(Queue queue)
                           throws JMSException
Create a QueueBrowser to peek at the messages on the specified queue.
Parameters:
queue - the queue to access
Throws:
JMSException - if a session fails to create a browser due to some JMS error.
InvalidDestinationException - if invalid Queue specified.

createBrowser

public QueueBrowser createBrowser(Queue queue,
                                  java.lang.String messageSelector)
                           throws JMSException
Create a QueueBrowser to peek at the messages on the specified queue.
Parameters:
queue - the queue to access
messageSelector - only messages with properties matching the message selector expression are delivered
Throws:
JMSException - if a session fails to create a browser due to some JMS error.
InvalidDestinationException - if invalid Queue specified.
InvalidSelectorException - if the message selector is invalid.

createTemporaryQueue

public TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Create a temporary queue. It's lifetime will be that of the QueueConnection unless deleted earlier.
Returns:
a temporary queue identity
Throws:
JMSException - if a session fails to create a Temporary Queue due to some JMS error.

JMS 1.0.2

JMS 1.0.2