From abc1a19fd4dee9729fd0aed721575a396d249bd4 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 16 Dec 2009 22:13:34 +0000
Subject: [PATCH] Migrate remaining future impls over to new future APIs.

---
 sdk/src/com/sun/opends/sdk/util/RecursiveFutureResult.java |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/sdk/src/com/sun/opends/sdk/util/RecursiveFutureResult.java b/sdk/src/com/sun/opends/sdk/util/RecursiveFutureResult.java
index de2e98d..1d96342 100644
--- a/sdk/src/com/sun/opends/sdk/util/RecursiveFutureResult.java
+++ b/sdk/src/com/sun/opends/sdk/util/RecursiveFutureResult.java
@@ -29,6 +29,7 @@
 
 
 
+import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
@@ -64,7 +65,15 @@
 
     public int getRequestID()
     {
-      return innerFuture.getRequestID();
+      if (innerFuture instanceof FutureResult<?>)
+      {
+        FutureResult<?> tmp = (FutureResult<?>) innerFuture;
+        return tmp.getRequestID();
+      }
+      else
+      {
+        return -1;
+      }
     }
 
 
@@ -89,11 +98,11 @@
 
   private final FutureResultImpl impl;
 
-  private volatile FutureResult<M> innerFuture = null;
+  private volatile Future<?> innerFuture = null;
 
   // This does not need to be volatile since the inner future acts as a
   // memory barrier.
-  private FutureResult<N> outerFuture = null;
+  private FutureResult<? extends N> outerFuture = null;
 
 
 
@@ -215,7 +224,7 @@
    * @param future
    *          The inner future.
    */
-  public final void setFutureResult(FutureResult<M> future)
+  public final void setFutureResult(Future<?> future)
   {
     this.innerFuture = future;
   }
@@ -239,7 +248,7 @@
    *           If the outer request could not be invoked and processing
    *           should terminate.
    */
-  protected FutureResult<N> chainErrorResult(
+  protected FutureResult<? extends N> chainErrorResult(
       ErrorResultException innerError, ResultHandler<? super N> handler)
       throws ErrorResultException
   {
@@ -261,7 +270,8 @@
    *           If the outer request could not be invoked and processing
    *           should terminate.
    */
-  protected abstract FutureResult<N> chainResult(M innerResult,
-      ResultHandler<? super N> handler) throws ErrorResultException;
+  protected abstract FutureResult<? extends N> chainResult(
+      M innerResult, ResultHandler<? super N> handler)
+      throws ErrorResultException;
 
 }

--
Gitblit v1.10.0