public interface EndpointInvocationFuture<T> extends DispatchedMessage, Future<T>
| Modifier and Type | Method and Description |
|---|---|
T |
getNow(T valueIfAbsent)
Returns the result value (or throws any encountered exception) if completed, else returns the given
valueIfAbsent.
|
void |
handle(java.util.function.BiConsumer<T,Throwable> consumer)
The given function is invoked with the result (or
null if none) and the exception (or null if
none) of this NetworkFuture when complete. |
T |
join()
Returns the result of invoking the method when complete, or throws an (unchecked) exception if completed
exceptionally.
|
EndpointInvocationFuture<T> |
orTimeout(long timeout,
TimeUnit unit)
Creates a new EndpointInvocationFuture that will time out via
TimeoutException if this task has not
completed within the specified time. |
<U> EndpointInvocationFuture<U> |
thenApply(java.util.function.Function<? super T,? extends U> fn) |
void |
thenRun(Runnable action) |
default EndpointInvocationFuture<T> |
timeout(long timeout,
TimeUnit unit)
Deprecated.
|
getMessageId, getPosition, getTime, relayedT getNow(T valueIfAbsent)
valueIfAbsent - the value to return if not completedCancellationException - if the computation was cancelledvoid handle(java.util.function.BiConsumer<T,Throwable> consumer)
null if none) and the exception (or null if
none) of this NetworkFuture when complete.consumer - the composer used for processing the resultT join()
CompletionException with
the underlying exception as its cause.CancellationException - if the invocation was cancelledCompletionException - if this future completed exceptionally or the remote invocation threw an exceptionEndpointInvocationFuture<T> orTimeout(long timeout, TimeUnit unit)
TimeoutException if this task has not
completed within the specified time.timeout - the maximum time to waitunit - the time unit of the timeout argument<U> EndpointInvocationFuture<U> thenApply(java.util.function.Function<? super T,? extends U> fn)
void thenRun(Runnable action)
@Deprecated default EndpointInvocationFuture<T> timeout(long timeout, TimeUnit unit)
Copyright © 2012–2015 Danish Maritime Authority. All rights reserved.