activemq-cpp-3.6.0
activemq::core::ActiveMQQueueBrowser Class Reference

#include <src/main/activemq/core/ActiveMQQueueBrowser.h>

Inheritance diagram for activemq::core::ActiveMQQueueBrowser:

Public Member Functions

 ActiveMQQueueBrowser (activemq::core::kernels::ActiveMQSessionKernel *session, const Pointer< commands::ConsumerId > &consumerId, const Pointer< commands::ActiveMQDestination > &destination, const std::string &selector, bool dispatchAsync)
virtual ~ActiveMQQueueBrowser ()
virtual const cms::QueuegetQueue () const
virtual std::string getMessageSelector () const
virtual cms::MessageEnumerationgetEnumeration ()
 Gets a pointer to an Enumeration object for browsing the Messages currently in the Queue in the order that a client would receive them.
virtual void close ()
 Closes this object and deallocates the appropriate resources.
virtual bool hasMoreMessages ()
 Returns true if there are more Message in the Browser that can be retrieved via the nextMessage method.
virtual cms::MessagenextMessage ()
 Returns the Next Message in the Queue if one is present, if no more Message's are available then an Exception is thrown.
- Public Member Functions inherited from cms::QueueBrowser
virtual ~QueueBrowser ()
- Public Member Functions inherited from cms::Closeable
virtual ~Closeable ()
- Public Member Functions inherited from cms::MessageEnumeration
virtual ~MessageEnumeration ()

Friends

class Browser

Constructor & Destructor Documentation

activemq::core::ActiveMQQueueBrowser::ActiveMQQueueBrowser ( activemq::core::kernels::ActiveMQSessionKernel session,
const Pointer< commands::ConsumerId > &  consumerId,
const Pointer< commands::ActiveMQDestination > &  destination,
const std::string &  selector,
bool  dispatchAsync 
)
virtual activemq::core::ActiveMQQueueBrowser::~ActiveMQQueueBrowser ( )
virtual

Member Function Documentation

virtual void activemq::core::ActiveMQQueueBrowser::close ( )
virtual

Closes this object and deallocates the appropriate resources.

The object is generally no longer usable after calling close.

Exceptions
CMSException- If an error occurs while the resource is being closed.

Implements cms::Closeable.

virtual cms::MessageEnumeration* activemq::core::ActiveMQQueueBrowser::getEnumeration ( )
virtual

Gets a pointer to an Enumeration object for browsing the Messages currently in the Queue in the order that a client would receive them.

The pointer returned is owned by the browser and should not be deleted by the client application.

Returns
a pointer to a Queue Enumeration, this Pointer is owned by the QueueBrowser and should not be deleted by the client.
Exceptions
CMSExceptionif an internal error occurs.

Implements cms::QueueBrowser.

virtual std::string activemq::core::ActiveMQQueueBrowser::getMessageSelector ( ) const
virtual
Returns
the MessageSelector that is used on when this browser was created or empty string if no selector was present.
Exceptions
CMSExceptionif an internal error occurs.

Implements cms::QueueBrowser.

virtual const cms::Queue* activemq::core::ActiveMQQueueBrowser::getQueue ( ) const
virtual
Returns
the Queue that this browser is listening on.
Exceptions
CMSExceptionif an internal error occurs.

Implements cms::QueueBrowser.

virtual bool activemq::core::ActiveMQQueueBrowser::hasMoreMessages ( )
virtual

Returns true if there are more Message in the Browser that can be retrieved via the nextMessage method.

If this method returns false and the nextMessage method is called then an Exception will be thrown.

Returns
true if more Message's are available in the Browser.

Implements cms::MessageEnumeration.

virtual cms::Message* activemq::core::ActiveMQQueueBrowser::nextMessage ( )
virtual

Returns the Next Message in the Queue if one is present, if no more Message's are available then an Exception is thrown.

If a Message object pointer is returned then that object becomes the property of the caller and must be deleted by the caller when finished.

Returns
The next Message in the Queue.
Exceptions
CMSExceptionif no more Message's currently in the Queue.

Implements cms::MessageEnumeration.

Friends And Related Function Documentation

friend class Browser
friend

The documentation for this class was generated from the following file: