Package org.jboss.netty.channel
Class FailedChannelFuture
- java.lang.Object
-
- org.jboss.netty.channel.CompleteChannelFuture
-
- org.jboss.netty.channel.FailedChannelFuture
-
- All Implemented Interfaces:
ChannelFuture
public class FailedChannelFuture extends CompleteChannelFuture
TheCompleteChannelFuturewhich is failed already. It is recommended to useChannels.failedFuture(Channel, Throwable)instead of calling the constructor of this future.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Throwablecause
-
Constructor Summary
Constructors Constructor Description FailedChannelFuture(Channel channel, java.lang.Throwable cause)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThrowablegetCause()Returns the cause of the failed I/O operation if the I/O operation has failed.booleanisSuccess()Returnstrueif and only if the I/O operation was completed successfully.private voidrethrow()ChannelFuturesync()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.ChannelFuturesyncUninterruptibly()Waits for this future until it is done, and rethrows the cause of the failure if this future failed.-
Methods inherited from class org.jboss.netty.channel.CompleteChannelFuture
addListener, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, cancel, getChannel, isCancelled, isDone, removeListener, setFailure, setProgress, setSuccess
-
-
-
-
Method Detail
-
getCause
public java.lang.Throwable getCause()
Description copied from interface:ChannelFutureReturns the cause of the failed I/O operation if the I/O operation has failed.- Returns:
- the cause of the failure.
nullif succeeded or this future is not completed yet.
-
isSuccess
public boolean isSuccess()
Description copied from interface:ChannelFutureReturnstrueif and only if the I/O operation was completed successfully.
-
sync
public ChannelFuture sync() throws java.lang.InterruptedException
Description copied from interface:ChannelFutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed. If the cause of the failure is a checked exception, it is wrapped with a newChannelExceptionbefore being thrown.- Throws:
java.lang.InterruptedException
-
syncUninterruptibly
public ChannelFuture syncUninterruptibly()
Description copied from interface:ChannelFutureWaits for this future until it is done, and rethrows the cause of the failure if this future failed. If the cause of the failure is a checked exception, it is wrapped with a newChannelExceptionbefore being thrown.
-
rethrow
private void rethrow()
-
-