From 2bc8d15a28fafab97cefafede06d6b7e738ae0fe Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 11 Dec 2009 18:45:45 +0000
Subject: [PATCH] Various incremental improvements.
---
sdk/src/org/opends/sdk/ResultFuture.java | 41 ++++++++++++++++++++---------------------
1 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/sdk/src/org/opends/sdk/ResultFuture.java b/sdk/src/org/opends/sdk/ResultFuture.java
index 63a8a09..e3a933f 100644
--- a/sdk/src/org/opends/sdk/ResultFuture.java
+++ b/sdk/src/org/opends/sdk/ResultFuture.java
@@ -34,18 +34,16 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import org.opends.sdk.responses.Result;
-
/**
* A handle which can be used to retrieve the Result of an asynchronous
* Request.
- *
+ *
* @param <S>
* The type of result returned by this future.
*/
-public interface ResultFuture<S extends Result> extends Future<S>
+public interface ResultFuture<S> extends Future<S>
{
/**
* Attempts to cancel the request. This attempt will fail if the
@@ -57,7 +55,7 @@
* always return {@code true}. Subsequent calls to
* {@link #isCancelled} will always return {@code true} if this method
* returned {@code true}.
- *
+ *
* @param mayInterruptIfRunning
* {@code true} if the thread executing executing the
* response handler should be interrupted; otherwise,
@@ -75,19 +73,20 @@
* the result if the request succeeded. If the request failed (i.e. a
* non-successful result code was obtained) then the result is thrown
* as an {@link ErrorResultException}.
- *
+ *
* @return The result, but only if the result code indicates that the
* request succeeded.
- * @throws CancellationException
- * If the request was cancelled using a call to
- * {@link #cancel}.
* @throws ErrorResultException
* If the result code indicates that the request failed for
* some reason.
+ * @throws CancellationException
+ * If the request was cancelled using a call to
+ * {@link #cancel}.
* @throws InterruptedException
* If the current thread was interrupted while waiting.
*/
- S get() throws InterruptedException, ErrorResultException;
+ S get() throws ErrorResultException, CancellationException,
+ InterruptedException;
@@ -96,32 +95,32 @@
* complete, and then returns the result if the request succeeded. If
* the request failed (i.e. a non-successful result code was obtained)
* then the result is thrown as an {@link ErrorResultException}.
- *
+ *
* @param timeout
* The maximum time to wait.
* @param unit
* The time unit of the timeout argument.
* @return The result, but only if the result code indicates that the
* request succeeded.
- * @throws CancellationException
- * If the request was cancelled using a call to
- * {@link #cancel}.
* @throws ErrorResultException
* If the result code indicates that the request failed for
* some reason.
- * @throws InterruptedException
- * If the current thread was interrupted while waiting.
* @throws TimeoutException
* If the wait timed out.
+ * @throws CancellationException
+ * If the request was cancelled using a call to
+ * {@link #cancel}.
+ * @throws InterruptedException
+ * If the current thread was interrupted while waiting.
*/
- S get(long timeout, TimeUnit unit) throws InterruptedException,
- TimeoutException, ErrorResultException;
+ S get(long timeout, TimeUnit unit) throws ErrorResultException,
+ TimeoutException, CancellationException, InterruptedException;
/**
* Returns the message ID of the request.
- *
+ *
* @return The message ID.
*/
int getMessageID();
@@ -131,7 +130,7 @@
/**
* Returns {@code true} if the request was cancelled before it
* completed normally.
- *
+ *
* @return {@code true} if the request was cancelled before it
* completed normally, otherwise {@code false}.
*/
@@ -145,7 +144,7 @@
* Completion may be due to normal termination, an exception, or
* cancellation. In all of these cases, this method will return
* {@code true}.
- *
+ *
* @return {@code true} if the request has completed, otherwise
* {@code false}.
*/
--
Gitblit v1.10.0