Top Description Methods
com.google.common.util.concurrent

public Interface FutureCallback<V extends @Nullable Object>

Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, java.util.concurrent.ExecutionException, .Future, org.checkerframework.checker.nullness.qual.Nullable

A callback for accepting the results of a java.util.concurrent.Future computation asynchronously.

To attach to a ListenableFuture use Futures#addCallback.

Author
Anthony Zana
Since
10.0

Method Summary

Modifier and TypeMethod and Description
public void
onFailure(Throwable t)

Invoked when a Future computation fails or is canceled.

public void
onSuccess(V result)

Invoked with the result of the Future computation when it is successful.

Method Detail

onFailureback to summary
public void onFailure(Throwable t)

Invoked when a Future computation fails or is canceled.

If the future's get method throws an ExecutionException, then the cause is passed to this method. Any other thrown object is passed unaltered.

onSuccessback to summary
public void onSuccess(V result)

Invoked with the result of the Future computation when it is successful.