From a049dae807fd20b9e1755c8bbf469db28cfe5c5a Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Fri, 15 Jun 2012 17:21:01 +0000 Subject: QPID-4027 Added constants FOREVER, IMMEDIATE, SECOND and MINUTE. git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/address-refactor2@1350703 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/qpid/messaging/Receiver.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'qpid/java/client-api') diff --git a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/Receiver.java b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/Receiver.java index dbb6c88b7a..337d21c99d 100644 --- a/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/Receiver.java +++ b/qpid/java/client-api/src/main/java/org/apache/qpid/messaging/Receiver.java @@ -22,6 +22,26 @@ package org.apache.qpid.messaging; */ public interface Receiver { + /** + * If passed as timeout, it will block indefinitely until a message arrives. + */ + public static long FOREVER = 0; + + /** + * If passed as timeout, it will return immediately. + */ + public static long IMMEDIATE = 0; + + /** + * If passed as timeout, it will wait a second until a message arrives. + */ + public static long SECOND = 1000; + + /** + * If passed as timeout, it will wait a minute until a message arrives. + */ + public static long MINUTE = 60000; + /** * Retrieves a message from this receivers local queue, or waits for upto the specified timeout for a message to become available. * A timeout of zero never expires, and the call blocks indefinitely until a message arrives. @@ -46,6 +66,7 @@ public interface Receiver /** * Returns the capacity of this receiver + * * @return capacity */ public int getCapacity() throws MessagingException; @@ -70,7 +91,7 @@ public interface Receiver /** * Returns true if the receiver was closed by a call to close() */ - public boolean isClosed() throws MessagingException; + public boolean isClosed(); /** * Returns the name that uniquely identifies this receiver within the given session. -- cgit v1.2.1