Package io.netty.channel
Class FailedChannelFuture
- java.lang.Object
-
- io.netty.util.concurrent.AbstractFuture<V>
-
- io.netty.util.concurrent.CompleteFuture<java.lang.Void>
-
- io.netty.channel.CompleteChannelFuture
-
- io.netty.channel.FailedChannelFuture
-
- All Implemented Interfaces:
ChannelFuture
,Future<java.lang.Void>
,java.util.concurrent.Future<java.lang.Void>
final class FailedChannelFuture extends CompleteChannelFuture
TheCompleteChannelFuture
which is failed already. It is recommended to useChannelOutboundInvoker.newFailedFuture(Throwable)
instead of calling the constructor of this future.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Throwable
cause
-
Constructor Summary
Constructors Constructor Description FailedChannelFuture(Channel channel, EventExecutor executor, java.lang.Throwable cause)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
cause()
Returns the cause of the failed I/O operation if the I/O operation has failed.boolean
isSuccess()
Returnstrue
if and only if the I/O operation was completed successfully.ChannelFuture
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.ChannelFuture
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.-
Methods inherited from class io.netty.channel.CompleteChannelFuture
addListener, addListeners, await, awaitUninterruptibly, channel, executor, getNow, isVoid, removeListener, removeListeners
-
Methods inherited from class io.netty.util.concurrent.CompleteFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, isCancellable, isCancelled, isDone
-
Methods inherited from class io.netty.util.concurrent.AbstractFuture
get, get
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.util.concurrent.Future
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, isCancellable
-
-
-
-
Constructor Detail
-
FailedChannelFuture
FailedChannelFuture(Channel channel, EventExecutor executor, java.lang.Throwable cause)
Creates a new instance.- Parameters:
channel
- theChannel
associated with this futurecause
- the cause of failure
-
-
Method Detail
-
cause
public java.lang.Throwable cause()
Description copied from interface:Future
Returns the cause of the failed I/O operation if the I/O operation has failed.- Returns:
- the cause of the failure.
null
if succeeded or this future is not completed yet.
-
isSuccess
public boolean isSuccess()
Description copied from interface:Future
Returnstrue
if and only if the I/O operation was completed successfully.
-
sync
public ChannelFuture sync()
Description copied from interface:Future
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
sync
in interfaceChannelFuture
- Specified by:
sync
in interfaceFuture<java.lang.Void>
- Overrides:
sync
in classCompleteChannelFuture
-
syncUninterruptibly
public ChannelFuture syncUninterruptibly()
Description copied from interface:Future
Waits for this future until it is done, and rethrows the cause of the failure if this future failed.- Specified by:
syncUninterruptibly
in interfaceChannelFuture
- Specified by:
syncUninterruptibly
in interfaceFuture<java.lang.Void>
- Overrides:
syncUninterruptibly
in classCompleteChannelFuture
-
-