activemq-cpp-3.4.0

cms::QueueBrowser Class Reference

This class implements in interface for browsing the messages in a Queue without removing them. More...

#include <src/main/cms/QueueBrowser.h>

Inheritance diagram for cms::QueueBrowser:

Public Member Functions

virtual ~QueueBrowser () throw ()
virtual const QueuegetQueue () const =0
virtual std::string getMessageSelector () const =0
virtual cms::MessageEnumerationgetEnumeration ()=0
 Gets a pointer to an Enumeration object for browsing the Messages currently in the Queue in the order that a client would receive them.

Detailed Description

This class implements in interface for browsing the messages in a Queue without removing them.

To browse the contents of the Queue the client calls the getEnumeration method to retrieve a new instance of a Queue Enumerator. The client then calls the hasMoreMessages method of the Enumeration, if it returns true the client can safely call the nextMessage method of the Enumeration instance.

Enumeration* enumeration = queueBrowser->getEnumeration();

while( enumeration->hasMoreMessages() ) { cms::Message* message = enumeration->nextMessage();

// ... Do something with the Message.

delete message; }

Since:
1.1

Constructor & Destructor Documentation

virtual cms::QueueBrowser::~QueueBrowser ( ) throw () [virtual]

Member Function Documentation

virtual cms::MessageEnumeration* cms::QueueBrowser::getEnumeration ( ) [pure 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.

Implemented in activemq::core::ActiveMQQueueBrowser.

virtual std::string cms::QueueBrowser::getMessageSelector ( ) const [pure 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.

Implemented in activemq::core::ActiveMQQueueBrowser.

virtual const Queue* cms::QueueBrowser::getQueue ( ) const [pure virtual]
Returns:
the Queue that this browser is listening on.
Exceptions:
CMSExceptionif an internal error occurs.

Implemented in activemq::core::ActiveMQQueueBrowser.


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