diff options
| author | Alan Conway <aconway@apache.org> | 2010-05-14 13:55:18 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-05-14 13:55:18 +0000 |
| commit | 71975bc9bca46868053cc683105f74efd550f2b0 (patch) | |
| tree | bffe7687b5bc6a36490be34b60475d2d902c175c /qpid/cpp/include | |
| parent | f91c20c40ec882ab116aeac47b09b7c6da96a658 (diff) | |
| download | qpid-python-71975bc9bca46868053cc683105f74efd550f2b0.tar.gz | |
Initial multi-thread unit test for messaging API.
- added Receiver::isClosed() to test for local close.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@944261 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/include')
| -rw-r--r-- | qpid/cpp/include/qpid/messaging/Receiver.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/qpid/cpp/include/qpid/messaging/Receiver.h b/qpid/cpp/include/qpid/messaging/Receiver.h index a368b113c1..2cd024f26f 100644 --- a/qpid/cpp/include/qpid/messaging/Receiver.h +++ b/qpid/cpp/include/qpid/messaging/Receiver.h @@ -49,8 +49,7 @@ class Receiver : public qpid::messaging::Handle<ReceiverImpl> /** * Retrieves a message from this receivers local queue, or waits * for upto the specified timeout for a message to become - * available. Returns false if there is no message to give after - * waiting for the specified timeout. + * available. */ QPID_CLIENT_EXTERN bool get(Message& message, Duration timeout=Duration::FOREVER); /** @@ -59,7 +58,8 @@ class Receiver : public qpid::messaging::Handle<ReceiverImpl> * available. * * @exception NoMessageAvailable if there is no message to give - * after waiting for the specified timeout. + * after waiting for the specified timeout, or if the Receiver is + * closed, in which case isClose() will be true. */ QPID_CLIENT_EXTERN Message get(Duration timeout=Duration::FOREVER); /** @@ -68,6 +68,10 @@ class Receiver : public qpid::messaging::Handle<ReceiverImpl> * available. Unlike get() this method will check with the server * that there is no message for the subscription this receiver is * serving before returning false. + * + * @return false if there is no message to give after + * waiting for the specified timeout, or if the Receiver is + * closed, in which case isClose() will be true. */ QPID_CLIENT_EXTERN bool fetch(Message& message, Duration timeout=Duration::FOREVER); /** @@ -78,7 +82,8 @@ class Receiver : public qpid::messaging::Handle<ReceiverImpl> * serving before throwing an exception. * * @exception NoMessageAvailable if there is no message to give - * after waiting for the specified timeout. + * after waiting for the specified timeout, or if the Receiver is + * closed, in which case isClose() will be true. */ QPID_CLIENT_EXTERN Message fetch(Duration timeout=Duration::FOREVER); /** @@ -88,19 +93,19 @@ class Receiver : public qpid::messaging::Handle<ReceiverImpl> */ QPID_CLIENT_EXTERN void setCapacity(uint32_t); /** - * Returns the capacity of the receiver. The capacity determines + * @return the capacity of the receiver. The capacity determines * how many incoming messages can be held in the receiver before * being requested by a client via fetch() (or pushed to a * listener). */ QPID_CLIENT_EXTERN uint32_t getCapacity(); /** - * Returns the number of messages received and waiting to be + * @return the number of messages received and waiting to be * fetched. */ QPID_CLIENT_EXTERN uint32_t getAvailable(); /** - * Returns a count of the number of messages received on this + * @return a count of the number of messages received on this * receiver that have been acknowledged, but for which that * acknowledgement has not yet been confirmed as processed by the * server. @@ -113,6 +118,11 @@ class Receiver : public qpid::messaging::Handle<ReceiverImpl> QPID_CLIENT_EXTERN void close(); /** + * Return true if the receiver was closed by a call to close() + */ + QPID_CLIENT_EXTERN bool isClosed() const; + + /** * Returns the name of this receiver. */ QPID_CLIENT_EXTERN const std::string& getName() const; |
