Constructor and Description |
---|
AggregateFuture(Future<T>... futures)
Construct from a set of futures which is copied
internally.
|
AggregateFuture(List<Future<T>> components)
Construct from a non-null list of components which is copied
internally.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Canceling an aggregate future succeeds only if canceling
all of its components succeeds.
|
List<T> |
get() |
List<T> |
get(long timeout,
TimeUnit unit) |
boolean |
isCancelled()
An aggregate is canceled iff at least one of its components is canceled.
|
boolean |
isDone()
An aggregate is done iff all of its components are done.
|
public AggregateFuture(Future<T>... futures)
Construct from a set of futures which is copied internally.
public boolean cancel(boolean mayInterruptIfRunning)
Canceling an aggregate future succeeds only if canceling all of its components succeeds. Note that during the process some components may be canceled while others not which would lead to an inconsistent state.
public List<T> get() throws InterruptedException, ExecutionException
get
in interface Future<List<T>>
InterruptedException
ExecutionException
public List<T> get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<List<T>>
InterruptedException
ExecutionException
TimeoutException
public boolean isCancelled()
isCancelled
in interface Future<List<T>>
Copyright © 2015. All rights reserved.