public class

JDKFuture

extends AbstractListenableFuture<V>
java.lang.Object
   ↳ com.ning.http.client.listenable.AbstractListenableFuture<V>
     ↳ com.ning.http.client.providers.jdk.JDKFuture<V>
Known Direct Subclasses

Summary

Fields
protected final AsyncHandler<V> asyncHandler
protected final AtomicBoolean cancelled
protected final AtomicBoolean contentProcessed
protected final AtomicReference<Throwable> exception
protected Future<V> innerFuture
protected final AtomicBoolean isDone
protected final int responseTimeoutInMs
protected final AtomicBoolean timedOut
protected final AtomicLong touch
protected final HttpURLConnection urlConnection
Public Constructors
JDKFuture(AsyncHandler<V> asyncHandler, int responseTimeoutInMs, HttpURLConnection urlConnection)
Public Methods
void abort(Throwable t)
boolean cancel(boolean mayInterruptIfRunning)
void content(V v)
void done(Callable callable)
V get()
V get(long timeout, TimeUnit unit)
boolean getAndSetWriteBody(boolean writeBody)
boolean getAndSetWriteHeaders(boolean writeHeaders)
boolean hasExpired()
Is the Future still valid
boolean isCancelled()
boolean isDone()
void touch()
Protected Methods
void setInnerFuture(Future<V> innerFuture)
[Expand]
Inherited Methods
From class com.ning.http.client.listenable.AbstractListenableFuture
From class java.lang.Object
From interface com.ning.http.client.ListenableFuture
From interface java.util.concurrent.Future

Fields

protected final AsyncHandler<V> asyncHandler

protected final AtomicBoolean cancelled

protected final AtomicBoolean contentProcessed

protected final AtomicReference<Throwable> exception

protected Future<V> innerFuture

protected final AtomicBoolean isDone

protected final int responseTimeoutInMs

protected final AtomicBoolean timedOut

protected final AtomicLong touch

protected final HttpURLConnection urlConnection

Public Constructors

public JDKFuture (AsyncHandler<V> asyncHandler, int responseTimeoutInMs, HttpURLConnection urlConnection)

Public Methods

public void abort (Throwable t)

public boolean cancel (boolean mayInterruptIfRunning)

public void content (V v)

public void done (Callable callable)

public V get ()

Throws
InterruptedException
ExecutionException

public V get (long timeout, TimeUnit unit)

Throws
InterruptedException
ExecutionException
TimeoutException

public boolean getAndSetWriteBody (boolean writeBody)

public boolean getAndSetWriteHeaders (boolean writeHeaders)

public boolean hasExpired ()

Is the Future still valid

Returns
  • true if response has expired and should be terminated.

public boolean isCancelled ()

public boolean isDone ()

public void touch ()

Protected Methods

protected void setInnerFuture (Future<V> innerFuture)