public final class ListenableFutures extends Object
Futures
Modifier and Type | Method and Description |
---|---|
static <V> void |
addErrorLogging(com.google.common.util.concurrent.ListenableFuture<V> future,
org.slf4j.Logger logger,
String message)
Deprecated.
|
static <V> void |
addErrorLogging(com.google.common.util.concurrent.ListenableFuture<V> future,
org.slf4j.Logger logger,
String format,
Object... arguments)
Deprecated.
|
static <V> void |
addErrorLogging(com.google.common.util.concurrent.ListenableFuture<V> future,
org.slf4j.Logger logger,
String format,
Object arg)
Deprecated.
|
static <V,E extends Exception> |
checkedGet(com.google.common.util.concurrent.ListenableFuture<V> future,
Function<? super Exception,E> mapper) |
static <V,E extends Exception> |
checkedGet(com.google.common.util.concurrent.ListenableFuture<V> future,
Function<? super Exception,E> mapper,
long timeout,
TimeUnit unit) |
static <V> CompletionStage<V> |
toCompletionStage(com.google.common.util.concurrent.ListenableFuture<V> future)
Converts a Guava ListenableFuture to a Java 8 CompletionStage.
|
public static <V> CompletionStage<V> toCompletionStage(com.google.common.util.concurrent.ListenableFuture<V> future)
CompletionStages.toListenableFuture(CompletionStage)
for the inverse function of this.
and CompletableFutures.toListenableFuture(java.util.concurrent.CompletableFuture)
for a related function.@Deprecated public static <V> void addErrorLogging(com.google.common.util.concurrent.ListenableFuture<V> future, org.slf4j.Logger logger, String message)
LoggingFutures.addErrorLogging(ListenableFuture, Logger, String)
instead.Instead of using this helper, you should consider directly using
Futures.addCallback(ListenableFuture, com.google.common.util.concurrent.FutureCallback,
java.util.concurrent.Executor)
to add a callback which does real error recovery in case of a failure instead
of just logging an error, if you can.
@Deprecated public static <V> void addErrorLogging(com.google.common.util.concurrent.ListenableFuture<V> future, org.slf4j.Logger logger, String format, Object arg)
LoggingFutures.addErrorLogging(ListenableFuture, Logger, String, Object)
instead.Instead of using this helper, you should consider directly using
Futures.addCallback(ListenableFuture, com.google.common.util.concurrent.FutureCallback,
java.util.concurrent.Executor)
to add a callback which does real error recovery in case of a failure instead
of just logging an error, if you can.
@Deprecated public static <V> void addErrorLogging(com.google.common.util.concurrent.ListenableFuture<V> future, org.slf4j.Logger logger, String format, Object... arguments)
LoggingFutures.addErrorLogging(ListenableFuture, Logger, String, Object...)
instead.Instead of using this helper, you should consider directly using
Futures.addCallback(ListenableFuture, com.google.common.util.concurrent.FutureCallback,
java.util.concurrent.Executor)
to add a callback which does real error recovery in case of a failure instead
of just logging an error, if you can.
public static <V,E extends Exception> V checkedGet(com.google.common.util.concurrent.ListenableFuture<V> future, Function<? super Exception,E> mapper) throws E extends Exception
E extends Exception
public static <V,E extends Exception> V checkedGet(com.google.common.util.concurrent.ListenableFuture<V> future, Function<? super Exception,E> mapper, long timeout, TimeUnit unit) throws E extends Exception, TimeoutException
E extends Exception
TimeoutException
Copyright © 2019 OpenDaylight. All rights reserved.