org.huihoo.jfox.ms.jms.queue
Class QueueSessionImpl

java.lang.Object
  extended byorg.huihoo.jfox.ms.jms.base.SessionImpl
      extended byorg.huihoo.jfox.ms.jms.queue.QueueSessionImpl
All Implemented Interfaces:
javax.jms.QueueSession, java.lang.Runnable, javax.jms.Session

public class QueueSessionImpl
extends SessionImpl
implements javax.jms.QueueSession

This class implements the JMS queue session. The queue session object is received from a queue connection.

Version:
Revision: 1.1 Date: 2003-05-20 21:29:53
Author:
Peter.Cheng

Field Summary
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
 
Constructor Summary
QueueSessionImpl(ConnectionImpl connection, boolean transacted, int acknowledgeMode)
           
 
Method Summary
protected  void addReceiver(QueueReceiverImpl queueReceiver)
          Add the specified receiver to the list of managed receivers.
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
          Creates a QueueBrowser object to peek at the messages on the specified queue.
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, java.lang.String messageSelector)
          Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
 javax.jms.Queue createQueue(java.lang.String queueName)
          Create a reference to a queue with given a Queue name.
 javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
          Creates a QueueSender object to send messages to the specified queue.
 javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue, java.lang.String messageSelector)
           
 javax.jms.QueueSender createSender(javax.jms.Queue queue)
          Create a QueueSender object to send messages to the specified queue.
 javax.jms.TemporaryQueue createTemporaryQueue()
          Creates a TemporaryQueue object.
 
Methods inherited from class org.huihoo.jfox.ms.jms.base.SessionImpl
addConsumer, close, commit, createBytesMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, getAcknowledgeMode, getConnection, getMessageListener, getTransacted, isClosed, isTransacted, recover, rollback, run, sendMessage, setMessageListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jms.Session
close, commit, createBytesMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, getMessageListener, getTransacted, recover, rollback, run, setMessageListener
 

Constructor Detail

QueueSessionImpl

public QueueSessionImpl(ConnectionImpl connection,
                        boolean transacted,
                        int acknowledgeMode)
Method Detail

createQueue

public javax.jms.Queue createQueue(java.lang.String queueName)
                            throws javax.jms.JMSException
Create a reference to a queue with given a Queue name.

Specified by:
createQueue in interface javax.jms.QueueSession
Parameters:
queueName -
Returns:
Queue
Throws:
javax.jms.JMSException

createReceiver

public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
                                       throws javax.jms.JMSException
Creates a QueueSender object to send messages to the specified queue.

Specified by:
createReceiver in interface javax.jms.QueueSession
Parameters:
queue - the Queue to access, or null if this is an unidentified producer
Returns:
QueueReceiver
Throws:
javax.jms.JMSException

createReceiver

public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue,
                                              java.lang.String messageSelector)
                                       throws javax.jms.JMSException
Specified by:
createReceiver in interface javax.jms.QueueSession
Parameters:
queue - the Queue to access, or null if this is an unidentified producer
messageSelector -
Returns:
QueueReceiver
Throws:
javax.jms.JMSException

createSender

public javax.jms.QueueSender createSender(javax.jms.Queue queue)
                                   throws javax.jms.JMSException
Create a QueueSender object to send messages to the specified queue.

Specified by:
createSender in interface javax.jms.QueueSession
Parameters:
queue -
Returns:
QueueSender
Throws:
javax.jms.JMSException

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
                                     throws javax.jms.JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue.

Specified by:
createBrowser in interface javax.jms.QueueSession
Parameters:
queue - the Queue to access
Throws:
javax.jms.JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid queue is specified.

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
                                            java.lang.String messageSelector)
                                     throws javax.jms.JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.

Specified by:
createBrowser in interface javax.jms.QueueSession
Parameters:
queue - the Queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
javax.jms.JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid queue is specified.
InvalidSelectorException - if the message selector is invalid.

createTemporaryQueue

public javax.jms.TemporaryQueue createTemporaryQueue()
                                              throws javax.jms.JMSException
Creates a TemporaryQueue object. Its lifetime will be that of the QueueConnection unless it is deleted earlier.

Specified by:
createTemporaryQueue in interface javax.jms.QueueSession
Returns:
a temporary queue identity
Throws:
javax.jms.JMSException - if the session fails to create a temporary queue due to some internal error.

addReceiver

protected void addReceiver(QueueReceiverImpl queueReceiver)
                    throws javax.jms.JMSException
Add the specified receiver to the list of managed receivers.

Parameters:
queueReceiver -
Throws:
javax.jms.JMSException


Copyright © 2002-2003 Open Enterprise Foundation. All Rights Reserved.