Top Description Methods
io.netty.util.concurrent

public Interface Promise<V>

extends Future<V>
Known Direct Subinterfaces
io.netty.util.concurrent.ProgressivePromise
Known Direct Implementers
io.netty.util.concurrent.DefaultPromise

Special Future which is writable.

Method Summary

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

Redeclares io.netty.util.concurrent.Future.addListener.

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

Redeclares io.netty.util.concurrent.Future.addListeners.

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

Redeclares io.netty.util.concurrent.Future.await.

Waits for this future to be completed.
public Promise<V>
awaitUninterruptibly()

Redeclares io.netty.util.concurrent.Future.awaitUninterruptibly.

Waits for this future to be completed without interruption.
public Promise<V>
removeListener(GenericFutureListener<? extends Future<? super V>> listener)

Redeclares io.netty.util.concurrent.Future.removeListener.

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

Redeclares io.netty.util.concurrent.Future.removeListeners.

Removes the first occurrence for each of the listeners from this future.
public Promise<V>
setFailure(Throwable cause)

Marks this future as a failure and notifies all listeners.

public Promise<V>
setSuccess(V result)

Marks this future as a success and notifies all listeners.

public boolean

Returns:

true if and only if successfully marked this future as uncancellable or it is already done without being cancelled. false if this future has been cancelled already.
setUncancellable
()

Make this future impossible to cancel.

public Promise<V>
sync()

Redeclares 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 Promise<V>
syncUninterruptibly()

Redeclares 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.
public boolean

Returns:

true if and only if successfully marked this future as a failure. Otherwise false because this future is already marked as either a success or a failure.
tryFailure
(Throwable cause)

Marks this future as a failure and notifies all listeners.

public boolean

Returns:

true if and only if successfully marked this future as a success. Otherwise false because this future is already marked as either a success or a failure.
trySuccess
(V result)

Marks this future as a success and notifies all listeners.

Inherited from io.netty.util.concurrent.Future:
awaitawaitawaitUninterruptiblyawaitUninterruptiblycancelcausegetNowisCancellableisSuccess

Method Detail

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

Redeclares 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 Promise<V> addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

Redeclares 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 Promise<V> await() throws InterruptedException

Redeclares 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
awaitUninterruptiblyback to summary
public Promise<V> awaitUninterruptibly()

Redeclares 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
removeListenerback to summary
public Promise<V> removeListener(GenericFutureListener<? extends Future<? super V>> listener)

Redeclares 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 Promise<V> removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

Redeclares 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
setFailureback to summary
public Promise<V> setFailure(Throwable cause)

Marks this future as a failure and notifies all listeners. If it is success or failed already it will throw an IllegalStateException.

setSuccessback to summary
public Promise<V> setSuccess(V result)

Marks this future as a success and notifies all listeners. If it is success or failed already it will throw an IllegalStateException.

setUncancellableback to summary
public boolean setUncancellable()

Make this future impossible to cancel.

Returns:boolean

true if and only if successfully marked this future as uncancellable or it is already done without being cancelled. false if this future has been cancelled already.

syncback to summary
public Promise<V> sync() throws InterruptedException

Redeclares 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 Promise<V> syncUninterruptibly()

Redeclares 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
tryFailureback to summary
public boolean tryFailure(Throwable cause)

Marks this future as a failure and notifies all listeners.

Returns:boolean

true if and only if successfully marked this future as a failure. Otherwise false because this future is already marked as either a success or a failure.

trySuccessback to summary
public boolean trySuccess(V result)

Marks this future as a success and notifies all listeners.

Returns:boolean

true if and only if successfully marked this future as a success. Otherwise false because this future is already marked as either a success or a failure.