Package com.ning.http.client
Class ListenableFuture.CompletedFailure<T>
java.lang.Object
com.ning.http.client.ListenableFuture.CompletedFailure<T>
- All Implemented Interfaces:
ListenableFuture<T>,Future<T>
- Enclosing interface:
- ListenableFuture<V>
public static class ListenableFuture.CompletedFailure<T>
extends Object
implements ListenableFuture<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ning.http.client.ListenableFuture
ListenableFuture.CompletedFailure<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Runnable listener, Executor exec) Adds a listener and executor to the ListenableFuture.booleancancel(boolean mayInterruptIfRunning) voiddone()Terminate and if there is no exception, mark this Future as done and release the internal lock.get()booleanbooleanisDone()voidtouch()Touch the current instance to prevent external service to times out.
-
Constructor Details
-
CompletedFailure
-
CompletedFailure
-
-
Method Details
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
done
public void done()Description copied from interface:ListenableFutureTerminate and if there is no exception, mark this Future as done and release the internal lock.- Specified by:
donein interfaceListenableFuture<T>
-
abort
Description copied from interface:ListenableFuture- Specified by:
abortin interfaceListenableFuture<T>
-
touch
public void touch()Description copied from interface:ListenableFutureTouch the current instance to prevent external service to times out.- Specified by:
touchin interfaceListenableFuture<T>
-
addListener
Description copied from interface:ListenableFutureAdds 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.
- Specified by:
addListenerin interfaceListenableFuture<T>- Parameters:
listener- the listener to run when the computation is complete.exec- the executor to run the listener in.- Returns:
- this Future
-