com.ning.http.client.providers.jdk
Class JDKDelegateFuture<V>

java.lang.Object
  extended by com.ning.http.client.listenable.AbstractListenableFuture<V>
      extended by com.ning.http.client.providers.jdk.JDKFuture<V>
          extended by com.ning.http.client.providers.jdk.JDKDelegateFuture<V>
All Implemented Interfaces:
ListenableFuture<V>, Future<V>

public class JDKDelegateFuture<V>
extends JDKFuture<V>


Field Summary
 
Fields inherited from class com.ning.http.client.providers.jdk.JDKFuture
asyncHandler, cancelled, contentProcessed, exception, innerFuture, isDone, responseTimeoutInMs, timedOut, touch, urlConnection
 
Constructor Summary
JDKDelegateFuture(AsyncHandler<V> asyncHandler, int responseTimeoutInMs, ListenableFuture<V> delegateFuture, HttpURLConnection urlConnection)
           
 
Method Summary
 void abort(Throwable t)
          Abort the current processing, and propagate the Throwable to the AsyncHandler or Future
 boolean cancel(boolean mayInterruptIfRunning)
           
 void done(Callable callable)
          Execute a Callable and if there is no exception, mark this Future as done and release the internal lock.
 V get(long timeout, TimeUnit unit)
           
 boolean isCancelled()
           
 
Methods inherited from class com.ning.http.client.providers.jdk.JDKFuture
content, get, getAndSetWriteBody, getAndSetWriteHeaders, hasExpired, isDone, setInnerFuture, touch
 
Methods inherited from class com.ning.http.client.listenable.AbstractListenableFuture
addListener, done
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDKDelegateFuture

public JDKDelegateFuture(AsyncHandler<V> asyncHandler,
                         int responseTimeoutInMs,
                         ListenableFuture<V> delegateFuture,
                         HttpURLConnection urlConnection)
Method Detail

done

public void done(Callable callable)
Description copied from interface: ListenableFuture
Execute a Callable and if there is no exception, mark this Future as done and release the internal lock.

Specified by:
done in interface ListenableFuture<V>
Overrides:
done in class JDKFuture<V>

abort

public void abort(Throwable t)
Description copied from interface: ListenableFuture
Abort the current processing, and propagate the Throwable to the AsyncHandler or Future

Specified by:
abort in interface ListenableFuture<V>
Overrides:
abort in class JDKFuture<V>

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<V>
Overrides:
cancel in class JDKFuture<V>

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<V>
Overrides:
isCancelled in class JDKFuture<V>

get

public V get(long timeout,
             TimeUnit unit)
      throws InterruptedException,
             ExecutionException,
             TimeoutException
Specified by:
get in interface Future<V>
Overrides:
get in class JDKFuture<V>
Throws:
InterruptedException
ExecutionException
TimeoutException


Copyright © 2011. All Rights Reserved.