qpid::broker::Queue Class Reference

The brokers representation of an amqp queue. More...

#include <BrokerQueue.h>

Inheritance diagram for qpid::broker::Queue:

Inheritance graph
[legend]
Collaboration diagram for qpid::broker::Queue:

Collaboration graph
[legend]
List of all members.

Public Types

typedef boost::shared_ptr<
Queue
shared_ptr
typedef std::vector< shared_ptr > vector

Public Member Functions

 Queue (const string &name, uint32_t autodelete=0, MessageStore *const store=0, const ConnectionToken *const owner=0)
void create (const qpid::framing::FieldTable &settings)
void configure (const qpid::framing::FieldTable &settings)
void destroy ()
void deliver (Message::shared_ptr &msg)
 Delivers a message to the queue.
void process (Message::shared_ptr &msg)
 Dispatches the messages immediately to a consumer if one is available or stores it for later if not.
void recover (Message::shared_ptr &msg)
 Used during recovery to add stored messages back to the queue.
void dispatch ()
 Dispatch any queued messages providing there are consumers for them.
void consume (Consumer *c, bool exclusive=false)
void cancel (Consumer *c)
uint32_t purge ()
uint32_t getMessageCount () const
uint32_t getConsumerCount () const
const string & getName () const
const bool isExclusiveOwner (const ConnectionToken *const o) const
bool hasExclusiveConsumer () const
bool canAutoDelete () const
void enqueue (TransactionContext *ctxt, Message::shared_ptr &msg)
void dequeue (TransactionContext *ctxt, Message::shared_ptr &msg)
 dequeue from store (only done once messages is acknowledged)
Message::shared_ptr dequeue ()
 dequeues from memory only
const QueuePolicy *const getPolicy ()
uint64_t getPersistenceId () const
 Returns any identifier the store may have attached to this object.
void setPersistenceId (uint64_t persistenceId) const
 Allows the store to attach its own identifier to this object.
void encode (framing::Buffer &buffer) const
 Encodes the persistable state of this object into the supplied buffer.
uint32_t encodedSize () const

Static Public Member Functions

static Queue::shared_ptr decode (QueueRegistry &queues, framing::Buffer &buffer)

Detailed Description

The brokers representation of an amqp queue.

Messages are delivered to a queue from where they can be dispatched to registered consumers or be stored until dequeued or until one or more consumers registers.


Member Function Documentation

void qpid::broker::Queue::deliver ( Message::shared_ptr &  msg  ) 

Delivers a message to the queue.

Will record it as enqueued if persistent then process it.

void qpid::broker::Queue::dispatch (  ) 

Dispatch any queued messages providing there are consumers for them.

Only one thread can be dispatching at any time, but this method (rather than the caller) is responsible for ensuring that.

uint32_t qpid::broker::Queue::encodedSize (  )  const [virtual]

Returns:
the size of the buffer needed to encode this object

Implements qpid::broker::Persistable.


The documentation for this class was generated from the following file:
Generated on Tue Apr 17 14:22:13 2007 for Qpid by  doxygen 1.4.7