public final class FailedFuture<V> extends CompleteFuture<V>
CompleteFuture
which is failed already. It is
recommended to use EventExecutor.newFailedFuture(Throwable)
instead of calling the constructor of this future.Constructor and Description |
---|
FailedFuture(EventExecutor executor,
Throwable cause)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
cause()
Returns the cause of the failed I/O operation if the I/O operation has
failed.
|
V |
getNow()
Return the result without blocking.
|
boolean |
isSuccess()
Returns
true if and only if the I/O operation was completed
successfully. |
Future<V> |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
Future<V> |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
addListener, addListeners, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, executor, isCancellable, isCancelled, isDone, removeListener, removeListeners
get, get
public FailedFuture(EventExecutor executor, Throwable cause)
executor
- the EventExecutor
associated with this futurecause
- the cause of failurepublic Throwable cause()
Future
null
if succeeded or this future is not
completed yet.public boolean isSuccess()
Future
true
if and only if the I/O operation was completed
successfully.public Future<V> sync()
Future
sync
in class CompleteFuture<V>
public Future<V> syncUninterruptibly()
Future
syncUninterruptibly
in class CompleteFuture<V>
public V getNow()
Future
null
.
As it is possible that a null
value is used to mark the future as successful you also need to check
if the future is really done with Future.isDone()
and not relay on the returned null
value.Copyright © 2008–2019 The Netty Project. All rights reserved.