From 71975bc9bca46868053cc683105f74efd550f2b0 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 14 May 2010 13:55:18 +0000 Subject: 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 --- qpid/cpp/include/qpid/messaging/Receiver.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'qpid/cpp/include') 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 /** * 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 * 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 * 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 * 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 */ 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. @@ -112,6 +117,11 @@ class Receiver : public qpid::messaging::Handle */ 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. */ -- cgit v1.2.1