summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2012-06-15 17:21:01 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2012-06-15 17:21:01 +0000
commita049dae807fd20b9e1755c8bbf469db28cfe5c5a (patch)
tree94e5ee5c8b9a2efa60b5b0cca9c265d36ee206c9
parent95906fe274ca7a1b407680a23858483d5253791b (diff)
downloadqpid-python-a049dae807fd20b9e1755c8bbf469db28cfe5c5a.tar.gz
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
-rw-r--r--qpid/java/client-api/src/main/java/org/apache/qpid/messaging/Receiver.java23
1 files changed, 22 insertions, 1 deletions
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
@@ -23,6 +23,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.
* @param timeout Timeout in milliseconds.
@@ -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.