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>, java.util.concurrent.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, java.net.HttpURLConnection urlConnection)
           
 
Method Summary
 void abort(java.lang.Throwable t)
          Abort the current processing, and propagate the Throwable to the AsyncHandler or Future
 boolean cancel(boolean mayInterruptIfRunning)
           
 void done(java.util.concurrent.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, java.util.concurrent.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,
                         java.net.HttpURLConnection urlConnection)
Method Detail

done

public void done(java.util.concurrent.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(java.lang.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 java.util.concurrent.Future<V>
Overrides:
cancel in class JDKFuture<V>

isCancelled

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

get

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


Copyright © 2011. All Rights Reserved.