Example usage for com.google.common.util.concurrent Futures getChecked

List of usage examples for com.google.common.util.concurrent Futures getChecked

Introduction

In this page you can find the example usage for com.google.common.util.concurrent Futures getChecked.

Prototype

@GwtIncompatible("reflection")
public static <V, X extends Exception> V getChecked(Future<V> future, Class<X> exceptionClass, long timeout,
        TimeUnit unit) throws X 

Source Link

Document

Returns the result of Future#get(long,TimeUnit) , converting most exceptions to a new instance of the given checked exception type.

Usage

From source file:org.onosproject.store.consistent.impl.DefaultAtomicValue.java

private static <V> V complete(CompletableFuture<V> future) {
    return Futures.getChecked(future, StorageException.class, OPERATION_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
}