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

public abstract Class CompleteFuture<V>

extends AbstractFuture<V>
Class Inheritance
Known Direct Subclasses
io.netty.util.concurrent.FailedFuture, io.netty.util.concurrent.SucceededFuture
Imports
io.netty.util.internal.ObjectUtil, java.util.concurrent.TimeUnit

A skeletal Future implementation which represents a Future which has been completed already.

Field Summary

Modifier and TypeField and Description
private final EventExecutor

Constructor Summary

AccessConstructor and Description
protected
CompleteFuture(EventExecutor
the EventExecutor associated with this future
executor
)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public Future<V>
addListener(GenericFutureListener<? extends Future<? super V>> listener)

Implements io.netty.util.concurrent.Future.addListener.

Adds the specified listener to this future.
public Future<V>
addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

Implements io.netty.util.concurrent.Future.addListeners.

Adds the specified listeners to this future.
public Future<V>
await()

Implements io.netty.util.concurrent.Future.await.

Waits for this future to be completed.
public boolean
await(long timeout, TimeUnit unit)

Implements io.netty.util.concurrent.Future.await.

Waits for this future to be completed within the specified time limit.
public boolean
await(long timeoutMillis)

Implements io.netty.util.concurrent.Future.await.

Waits for this future to be completed within the specified time limit.
public Future<V>
awaitUninterruptibly()

Implements io.netty.util.concurrent.Future.awaitUninterruptibly.

Waits for this future to be completed without interruption.
public boolean
awaitUninterruptibly(long timeout, TimeUnit unit)

Implements io.netty.util.concurrent.Future.awaitUninterruptibly.

Waits for this future to be completed within the specified time limit without interruption.
public boolean
awaitUninterruptibly(long timeoutMillis)

Implements io.netty.util.concurrent.Future.awaitUninterruptibly.

Waits for this future to be completed within the specified time limit without interruption.
public boolean
cancel(boolean
this value has no effect in this implementation.
mayInterruptIfRunning
)

Implements io.netty.util.concurrent.Future.cancel.

Attempts to cancel execution of this task.
protected EventExecutor
executor()

Return the EventExecutor which is used by this CompleteFuture.

public boolean
isCancellable()

Implements io.netty.util.concurrent.Future.isCancellable.

returns true if and only if the operation can be cancelled via cancel(boolean).
public boolean
isCancelled()

Implements java.util.concurrent.Future.isCancelled.

Returns true if this task was cancelled before it completed normally.
public boolean
isDone()

Implements java.util.concurrent.Future.isDone.

Returns true if this task completed.
public Future<V>
removeListener(GenericFutureListener<? extends Future<? super V>> listener)

Implements io.netty.util.concurrent.Future.removeListener.

Removes the first occurrence of the specified listener from this future.
public Future<V>
removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

Implements io.netty.util.concurrent.Future.removeListeners.

Removes the first occurrence for each of the listeners from this future.
public Future<V>
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()

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.AbstractFuture:
getget

Field Detail

executorback to summary
private final EventExecutor executor

Constructor Detail

CompleteFutureback to summary
protected CompleteFuture(EventExecutor executor)

Creates a new instance.

Parameters
executor:EventExecutor

the EventExecutor associated with this future

Method Detail

addListenerback to summary
public Future<V> addListener(GenericFutureListener<? extends Future<? super V>> listener)

Implements io.netty.util.concurrent.Future.addListener.

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

Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.

Annotations
@Override
addListenersback to summary
public Future<V> addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

Implements io.netty.util.concurrent.Future.addListeners.

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

Adds the specified listeners to this future. The specified listeners are notified when this future is done. If this future is already completed, the specified listeners are notified immediately.

Annotations
@Override
awaitback to summary
public Future<V> await() throws InterruptedException

Implements io.netty.util.concurrent.Future.await.

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

Waits for this future to be completed.

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted
awaitback to summary
public boolean await(long timeout, TimeUnit unit) throws InterruptedException

Implements io.netty.util.concurrent.Future.await.

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

Waits for this future to be completed within the specified time limit.

Returns:boolean

true if and only if the future was completed within the specified time limit

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted
awaitback to summary
public boolean await(long timeoutMillis) throws InterruptedException

Implements io.netty.util.concurrent.Future.await.

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

Waits for this future to be completed within the specified time limit.

Returns:boolean

true if and only if the future was completed within the specified time limit

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted
awaitUninterruptiblyback to summary
public Future<V> awaitUninterruptibly()

Implements io.netty.util.concurrent.Future.awaitUninterruptibly.

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

Waits for this future to be completed without interruption. This method catches an InterruptedException and discards it silently.

Annotations
@Override
awaitUninterruptiblyback to summary
public boolean awaitUninterruptibly(long timeout, TimeUnit unit)

Implements io.netty.util.concurrent.Future.awaitUninterruptibly.

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

Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.

Returns:boolean

true if and only if the future was completed within the specified time limit

Annotations
@Override
awaitUninterruptiblyback to summary
public boolean awaitUninterruptibly(long timeoutMillis)

Implements io.netty.util.concurrent.Future.awaitUninterruptibly.

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

Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.

Returns:boolean

true if and only if the future was completed within the specified time limit

Annotations
@Override
cancelback to summary
public boolean cancel(boolean mayInterruptIfRunning)

Implements io.netty.util.concurrent.Future.cancel.

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

Attempts to cancel execution of this task. This method has no effect if the task is already completed or cancelled, or could not be cancelled for some other reason. Otherwise, if this task has not started when cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task (when known by the implementation) is interrupted in an attempt to stop the task.

The return value from this method does not necessarily indicate whether the task is now cancelled; use isCancelled. If the cancellation was successful it will fail the future with a CancellationException.

Parameters
mayInterruptIfRunning:boolean

this value has no effect in this implementation.

Returns:boolean

Doc from java.util.concurrent.Future.cancel.

false if the task could not be cancelled, typically because it has already completed; true otherwise. If two or more threads cause a task to be cancelled, then at least one of them returns true. Implementations may provide stronger guarantees.

Annotations
@Override
executorback to summary
protected EventExecutor executor()

Return the EventExecutor which is used by this CompleteFuture.

isCancellableback to summary
public boolean isCancellable()

Implements io.netty.util.concurrent.Future.isCancellable.

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

returns true if and only if the operation can be cancelled via cancel(boolean).

Annotations
@Override
isCancelledback to summary
public boolean isCancelled()

Implements java.util.concurrent.Future.isCancelled.

Doc from java.util.concurrent.Future.isCancelled.

Returns true if this task was cancelled before it completed normally.

Returns:boolean

true if this task was cancelled before it completed

Annotations
@Override
isDoneback to summary
public boolean isDone()

Implements java.util.concurrent.Future.isDone.

Doc from java.util.concurrent.Future.isDone.

Returns true if this task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.

Returns:boolean

true if this task completed

Annotations
@Override
removeListenerback to summary
public Future<V> removeListener(GenericFutureListener<? extends Future<? super V>> listener)

Implements io.netty.util.concurrent.Future.removeListener.

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

Removes the first occurrence of the specified listener from this future. The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.

Annotations
@Override
removeListenersback to summary
public Future<V> removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

Implements io.netty.util.concurrent.Future.removeListeners.

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

Removes the first occurrence for each of the listeners from this future. The specified listeners are no longer notified when this future is done. If the specified listeners are not associated with this future, this method does nothing and returns silently.

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

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()

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