net.sf.dropboxmq.messageconsumers
Class QueueBrowserImpl

java.lang.Object
  extended by net.sf.dropboxmq.messageconsumers.QueueBrowserImpl
All Implemented Interfaces:
QueueBrowser

public class QueueBrowserImpl
extends Object
implements QueueBrowser

Created: 14 Jan 2006

Version:
$Revision: 211 $, $Date: 2010-11-14 14:21:24 -0700 (Sun, 14 Nov 2010) $
Author:
Dwayne Schultz

Constructor Summary
QueueBrowserImpl(SessionImpl session, QueueImpl queue, String messageSelector)
           
 
Method Summary
 void close()
          Closes the QueueBrowser.
 Enumeration getEnumeration()
          Gets an enumeration for browsing the current queue messages in the order they would be received.
 String getMessageSelector()
          Gets this queue browser's message selector expression.
 Queue getQueue()
          Gets the queue associated with this queue browser.
protected  String toObjectString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueueBrowserImpl

public QueueBrowserImpl(SessionImpl session,
                        QueueImpl queue,
                        String messageSelector)
                 throws JMSException
Throws:
JMSException
Method Detail

getQueue

public Queue getQueue()
               throws JMSException
Description copied from interface: javax.jms.QueueBrowser
Gets the queue associated with this queue browser.

Specified by:
getQueue in interface QueueBrowser
Returns:
the queue
Throws:
JMSException - if the JMS provider fails to get the queue associated with this browser due to some internal error.

getMessageSelector

public String getMessageSelector()
                          throws JMSException
Description copied from interface: javax.jms.QueueBrowser
Gets this queue browser's message selector expression.

Specified by:
getMessageSelector in interface QueueBrowser
Returns:
this queue browser's message selector, or null if no message selector exists for the message consumer (that is, if the message selector was not set or was set to null or the empty string)
Throws:
JMSException - if the JMS provider fails to get the message selector for this browser due to some internal error.

getEnumeration

public Enumeration getEnumeration()
                           throws JMSException
Description copied from interface: javax.jms.QueueBrowser
Gets an enumeration for browsing the current queue messages in the order they would be received.

Specified by:
getEnumeration in interface QueueBrowser
Returns:
an enumeration for browsing the messages
Throws:
JMSException - if the JMS provider fails to get the enumeration for this browser due to some internal error.

close

public void close()
           throws JMSException
Description copied from interface: javax.jms.QueueBrowser
Closes the QueueBrowser.

Since a provider may allocate some resources on behalf of a QueueBrowser outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.

Specified by:
close in interface QueueBrowser
Throws:
JMSException - if the JMS provider fails to close this browser due to some internal error.

toObjectString

protected final String toObjectString()