activemq-cpp-3.4.0
|
This class implements in interface for browsing the messages in a Queue without removing them. More...
#include <src/main/cms/QueueBrowser.h>
Public Member Functions | |
virtual | ~QueueBrowser () throw () |
virtual const Queue * | getQueue () const =0 |
virtual std::string | getMessageSelector () const =0 |
virtual cms::MessageEnumeration * | getEnumeration ()=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. |
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; }
virtual cms::QueueBrowser::~QueueBrowser | ( | ) | throw () [virtual] |
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.
CMSException | if an internal error occurs. |
Implemented in activemq::core::ActiveMQQueueBrowser.
virtual std::string cms::QueueBrowser::getMessageSelector | ( | ) | const [pure virtual] |
CMSException | if an internal error occurs. |
Implemented in activemq::core::ActiveMQQueueBrowser.
virtual const Queue* cms::QueueBrowser::getQueue | ( | ) | const [pure virtual] |
CMSException | if an internal error occurs. |
Implemented in activemq::core::ActiveMQQueueBrowser.