Top Description Methods
io.netty.channel

public Interface ChannelPromise

extends ChannelFuture, Promise<Void>
Known Direct Subinterfaces
io.netty.channel.ChannelProgressivePromise
Known Direct Implementers
io.netty.channel.VoidChannelPromise, io.netty.channel.DefaultChannelPromise, io.netty.channel.DelegatingChannelPromiseNotifier
Imports
io.netty.util.concurrent.Future, .GenericFutureListener, .Promise

Special ChannelFuture which is writable.

Method Summary

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

Redeclares io.netty.channel.ChannelFuture.addListener, io.netty.util.concurrent.Promise.addListener.

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

Redeclares io.netty.channel.ChannelFuture.addListeners, io.netty.util.concurrent.Promise.addListeners.

Adds the specified listeners to this future.
public ChannelPromise
await()

Redeclares io.netty.channel.ChannelFuture.await, io.netty.util.concurrent.Promise.await.

Waits for this future to be completed.
public ChannelPromise
public Channel
channel()

Redeclares io.netty.channel.ChannelFuture.channel.

Returns a channel where the I/O operation associated with this future takes place.
public ChannelPromise
removeListener(GenericFutureListener<? extends Future<? super Void>> listener)

Redeclares io.netty.channel.ChannelFuture.removeListener, io.netty.util.concurrent.Promise.removeListener.

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

Redeclares io.netty.channel.ChannelFuture.removeListeners, io.netty.util.concurrent.Promise.removeListeners.

Removes the first occurrence for each of the listeners from this future.
public ChannelPromise
setFailure(Throwable cause)

Redeclares io.netty.util.concurrent.Promise.setFailure.

Marks this future as a failure and notifies all listeners.
public ChannelPromise
setSuccess(Void result)

Redeclares io.netty.util.concurrent.Promise.setSuccess.

Marks this future as a success and notifies all listeners.
public ChannelPromise
public ChannelPromise
sync()

Redeclares io.netty.channel.ChannelFuture.sync, io.netty.util.concurrent.Promise.sync.

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

Redeclares io.netty.channel.ChannelFuture.syncUninterruptibly, io.netty.util.concurrent.Promise.syncUninterruptibly.

Waits for this future until it is done, and rethrows the cause of the failure if this future failed.
public boolean
public ChannelPromise
unvoid()

Returns a new ChannelPromise if isVoid() returns true otherwise itself.

Inherited from io.netty.channel.ChannelFuture:
isVoid
Inherited from io.netty.util.concurrent.Promise:
setUncancellabletryFailuretrySuccess

Method Detail

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

Redeclares io.netty.channel.ChannelFuture.addListener, io.netty.util.concurrent.Promise.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 ChannelPromise addListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)

Redeclares io.netty.channel.ChannelFuture.addListeners, io.netty.util.concurrent.Promise.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 ChannelPromise await() throws InterruptedException

Redeclares io.netty.channel.ChannelFuture.await, io.netty.util.concurrent.Promise.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 ChannelPromise awaitUninterruptibly()

Redeclares io.netty.channel.ChannelFuture.awaitUninterruptibly, io.netty.util.concurrent.Promise.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
channelback to summary
public Channel channel()

Redeclares io.netty.channel.ChannelFuture.channel.

Doc from io.netty.channel.ChannelFuture.channel.

Returns a channel where the I/O operation associated with this future takes place.

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

Redeclares io.netty.channel.ChannelFuture.removeListener, io.netty.util.concurrent.Promise.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 ChannelPromise removeListeners(GenericFutureListener<? extends Future<? super Void>>... listeners)

Redeclares io.netty.channel.ChannelFuture.removeListeners, io.netty.util.concurrent.Promise.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 ChannelPromise setFailure(Throwable cause)

Redeclares io.netty.util.concurrent.Promise.setFailure.

Doc from io.netty.util.concurrent.Promise.setFailure.

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

Annotations
@Override
setSuccessback to summary
public ChannelPromise setSuccess(Void result)

Redeclares io.netty.util.concurrent.Promise.setSuccess.

Doc from io.netty.util.concurrent.Promise.setSuccess.

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

Annotations
@Override
setSuccessback to summary
public ChannelPromise setSuccess()
syncback to summary
public ChannelPromise sync() throws InterruptedException

Redeclares io.netty.channel.ChannelFuture.sync, io.netty.util.concurrent.Promise.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 ChannelPromise syncUninterruptibly()

Redeclares io.netty.channel.ChannelFuture.syncUninterruptibly, io.netty.util.concurrent.Promise.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
trySuccessback to summary
public boolean trySuccess()
unvoidback to summary
public ChannelPromise unvoid()

Returns a new ChannelPromise if isVoid() returns true otherwise itself.