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,
java.lang.Throwable cause)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.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, removeListenersget, getpublic FailedFuture(EventExecutor executor, java.lang.Throwable cause)
executor - the EventExecutor associated with this futurecause - the cause of failurepublic java.lang.Throwable cause()
Futurenull if succeeded or this future is not
completed yet.public boolean isSuccess()
Futuretrue if and only if the I/O operation was completed
successfully.public Future<V> sync()
Futuresync in class CompleteFuture<V>public Future<V> syncUninterruptibly()
FuturesyncUninterruptibly in class CompleteFuture<V>public V getNow()
Futurenull.
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–2018 The Netty Project. All rights reserved.