public interface

ListenableFuture

implements Future<V>
com.ning.http.client.ListenableFuture<V>
Known Indirect Subclasses

Class Overview

Extended Future

Summary

Public Methods
abstract void abort(Throwable t)
Abort the current processing, and propagate the Throwable to the AsyncHandler or Future
abstract ListenableFuture<V> addListener(Runnable listener, Executor exec)

Adds a listener and executor to the ListenableFuture.

abstract void content(V v)
Set the content that will be returned by this instance
abstract void done(Callable callable)
Execute a Callable and if there is no exception, mark this Future as done and release the internal lock.
abstract boolean getAndSetWriteBody(boolean writeBody)
Write the Request body
abstract boolean getAndSetWriteHeaders(boolean writeHeader)
Write the Request headers
abstract void touch()
Touch the current instance to prevent external service to times out.
[Expand]
Inherited Methods
From interface java.util.concurrent.Future

Public Methods

public abstract void abort (Throwable t)

Abort the current processing, and propagate the Throwable to the AsyncHandler or Future

public abstract ListenableFuture<V> addListener (Runnable listener, Executor exec)

Adds a listener and executor to the ListenableFuture. The listener will be passed to the executor for execution when the Future's computation is complete.

There is no guaranteed ordering of execution of listeners, they may get called in the order they were added and they may get called out of order, but any listener added through this method is guaranteed to be called once the computation is complete.

Parameters
listener the listener to run when the computation is complete.
exec the executor to run the listener in.
Returns
  • this Future
Throws
NullPointerException if the executor or listener was null.
RejectedExecutionException if we tried to execute the listener immediately but the executor rejected it.

public abstract void content (V v)

Set the content that will be returned by this instance

Parameters
v the content that will be returned by this instance

public abstract void done (Callable callable)

Execute a Callable and if there is no exception, mark this Future as done and release the internal lock.

public abstract boolean getAndSetWriteBody (boolean writeBody)

Write the Request body

public abstract boolean getAndSetWriteHeaders (boolean writeHeader)

Write the Request headers

public abstract void touch ()

Touch the current instance to prevent external service to times out.