Top Description Fields Constructors Methods
io.netty.util.concurrent

public final Class FailedFuture<V>

extends CompleteFuture<V>
Class Inheritance
Imports
io.netty.util.internal.ObjectUtil, .PlatformDependent

The CompleteFuture which is failed already. It is recommended to use EventExecutor#newFailedFuture(Throwable) instead of calling the constructor of this future.

Field Summary

Modifier and TypeField and Description
private final Throwable

Constructor Summary

AccessConstructor and Description
public
FailedFuture(EventExecutor
the EventExecutor associated with this future
executor
,
Throwable
the cause of failure
cause
)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public Throwable
cause()

Implements io.netty.util.concurrent.Future.cause.

Returns the cause of the failed I/O operation if the I/O operation has failed.
public V
getNow()

Implements io.netty.util.concurrent.Future.getNow.

Return the result without blocking.
public boolean
isSuccess()

Implements io.netty.util.concurrent.Future.isSuccess.

Returns true if and only if the I/O operation was completed successfully.
public Future<V>
sync()

Overrides io.netty.util.concurrent.CompleteFuture.sync.

Implements io.netty.util.concurrent.Future.sync.

Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
public Future<V>
syncUninterruptibly()

Overrides io.netty.util.concurrent.CompleteFuture.syncUninterruptibly.

Implements io.netty.util.concurrent.Future.syncUninterruptibly.

Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
Inherited from io.netty.util.concurrent.CompleteFuture:
addListeneraddListenersawaitawaitawaitawaitUninterruptiblyawaitUninterruptiblyawaitUninterruptiblycancelexecutorisCancellableisCancelledisDoneremoveListenerremoveListeners

Field Detail

causeback to summary
private final Throwable cause

Constructor Detail

FailedFutureback to summary
public FailedFuture(EventExecutor executor, Throwable cause)

Creates a new instance.

Parameters
executor:EventExecutor

the EventExecutor associated with this future

cause:Throwable

the cause of failure

Method Detail

causeback to summary
public Throwable cause()

Implements io.netty.util.concurrent.Future.cause.

Doc from io.netty.util.concurrent.Future.cause.

Returns the cause of the failed I/O operation if the I/O operation has failed.

Returns:Throwable

the cause of the failure. null if succeeded or this future is not completed yet.

Annotations
@Override
getNowback to summary
public V getNow()

Implements io.netty.util.concurrent.Future.getNow.

Doc from io.netty.util.concurrent.Future.getNow.

Return the result without blocking. If the future is not done yet this will return 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 isDone() and not rely on the returned null value.

Annotations
@Override
isSuccessback to summary
public boolean isSuccess()

Implements io.netty.util.concurrent.Future.isSuccess.

Doc from io.netty.util.concurrent.Future.isSuccess.

Returns true if and only if the I/O operation was completed successfully.

Annotations
@Override
syncback to summary
public Future<V> sync()

Overrides io.netty.util.concurrent.CompleteFuture.sync.

Implements io.netty.util.concurrent.Future.sync.

Doc from io.netty.util.concurrent.Future.sync.

Waits for this future until it is done, and rethrows the cause of the failure if this future failed.

Annotations
@Override
syncUninterruptiblyback to summary
public Future<V> syncUninterruptibly()

Overrides io.netty.util.concurrent.CompleteFuture.syncUninterruptibly.

Implements io.netty.util.concurrent.Future.syncUninterruptibly.

Doc from io.netty.util.concurrent.Future.syncUninterruptibly.

Waits for this future until it is done, and rethrows the cause of the failure if this future failed.

Annotations
@Override