Package | Description |
---|---|
com.google.common.util.concurrent |
Concurrency utilities.
|
Modifier and Type | Interface and Description |
---|---|
interface |
CheckedFuture<V,X extends Exception>
A
CheckedFuture is an extension of Future that includes
versions of the get methods that can throw a checked exception and
allows listeners to be attached to the future. |
Modifier and Type | Class and Description |
---|---|
class |
AbstractCheckedFuture<V,X extends Exception>
A delegating wrapper around a
ListenableFuture that adds support for
the AbstractCheckedFuture.checkedGet() and AbstractCheckedFuture.checkedGet(long, TimeUnit) methods. |
class |
AbstractListenableFuture<V>
An abstract base implementation of the listener support provided by
ListenableFuture . |
class |
ForwardingCheckedFuture<V,X extends Exception>
A future which forwards all its method calls to another future.
|
static class |
ForwardingCheckedFuture.SimpleForwardingCheckedFuture<V,X extends Exception>
A simplified version of
ForwardingCheckedFuture where subclasses
can pass in an already constructed CheckedFuture as the delegate. |
class |
ForwardingListenableFuture<V>
A
ListenableFuture which forwards all its method calls to another
future. |
static class |
ForwardingListenableFuture.SimpleForwardingListenableFuture<V>
A simplified version of
ForwardingListenableFuture where subclasses
can pass in an already constructed ListenableFuture
as the delegate. |
class |
ListenableFutureTask<V>
A
FutureTask that also implements the ListenableFuture
interface. |
class |
SettableFuture<V>
A
ListenableFuture whose result may be set by a SettableFuture.set(Object)
or SettableFuture.setException(Throwable) call. |
Modifier and Type | Field and Description |
---|---|
protected ListenableFuture<V> |
AbstractCheckedFuture.delegate
The delegate, used to pass along all our methods.
|
Modifier and Type | Method and Description |
---|---|
static <I,O> ListenableFuture<O> |
Futures.chain(ListenableFuture<I> input,
Function<? super I,? extends ListenableFuture<? extends O>> function)
Returns a new
ListenableFuture whose result is asynchronously
derived from the result of the given Future . |
static <I,O> ListenableFuture<O> |
Futures.chain(ListenableFuture<I> input,
Function<? super I,? extends ListenableFuture<? extends O>> function,
Executor exec)
Returns a new
ListenableFuture whose result is asynchronously
derived from the result of the given Future . |
protected abstract ListenableFuture<V> |
ForwardingListenableFuture.delegate() |
protected ListenableFuture<V> |
ForwardingListenableFuture.SimpleForwardingListenableFuture.delegate() |
static <V> ListenableFuture<V> |
Futures.immediateFailedFuture(Throwable throwable)
Returns a
ListenableFuture which has an exception set immediately
upon construction. |
static <V> ListenableFuture<V> |
Futures.immediateFuture(V value)
Creates a
ListenableFuture which has its value set immediately upon
construction. |
static <V> ListenableFuture<V> |
Futures.makeListenable(Future<V> future)
Creates a
ListenableFuture out of a normal Future . |
ListenableFuture<Service.State> |
AbstractExecutionThreadService.start() |
ListenableFuture<Service.State> |
Service.start()
If the service state is
Service.State.NEW , this initiates service startup
and returns immediately. |
ListenableFuture<Service.State> |
AbstractService.start() |
ListenableFuture<Service.State> |
AbstractIdleService.start() |
ListenableFuture<Service.State> |
ForwardingService.start() |
ListenableFuture<Service.State> |
AbstractExecutionThreadService.stop() |
ListenableFuture<Service.State> |
Service.stop()
|
ListenableFuture<Service.State> |
AbstractService.stop() |
ListenableFuture<Service.State> |
AbstractIdleService.stop() |
ListenableFuture<Service.State> |
ForwardingService.stop() |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> future,
Function<? super I,? extends O> function)
Returns a new
ListenableFuture whose result is the product of
applying the given Function to the result of the given Future . |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> future,
Function<? super I,? extends O> function,
Executor exec)
Returns a new
ListenableFuture whose result is the product of
applying the given Function to the result of the given Future . |
Modifier and Type | Method and Description |
---|---|
static <I,O> ListenableFuture<O> |
Futures.chain(ListenableFuture<I> input,
Function<? super I,? extends ListenableFuture<? extends O>> function)
Returns a new
ListenableFuture whose result is asynchronously
derived from the result of the given Future . |
static <I,O> ListenableFuture<O> |
Futures.chain(ListenableFuture<I> input,
Function<? super I,? extends ListenableFuture<? extends O>> function,
Executor exec)
Returns a new
ListenableFuture whose result is asynchronously
derived from the result of the given Future . |
static <V,X extends Exception> |
Futures.makeChecked(ListenableFuture<V> future,
Function<Exception,X> mapper)
Creates a
CheckedFuture out of a normal ListenableFuture
and a Function that maps from Exception instances into the
appropriate checked type. |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> future,
Function<? super I,? extends O> function)
Returns a new
ListenableFuture whose result is the product of
applying the given Function to the result of the given Future . |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> future,
Function<? super I,? extends O> function,
Executor exec)
Returns a new
ListenableFuture whose result is the product of
applying the given Function to the result of the given Future . |
Modifier and Type | Method and Description |
---|---|
static <I,O> ListenableFuture<O> |
Futures.chain(ListenableFuture<I> input,
Function<? super I,? extends ListenableFuture<? extends O>> function)
Returns a new
ListenableFuture whose result is asynchronously
derived from the result of the given Future . |
static <I,O> ListenableFuture<O> |
Futures.chain(ListenableFuture<I> input,
Function<? super I,? extends ListenableFuture<? extends O>> function,
Executor exec)
Returns a new
ListenableFuture whose result is asynchronously
derived from the result of the given Future . |
Constructor and Description |
---|
AbstractCheckedFuture(ListenableFuture<V> delegate)
Constructs an
AbstractCheckedFuture that wraps a delegate. |
ForwardingListenableFuture.SimpleForwardingListenableFuture(ListenableFuture<V> delegate) |