Top Description Fields Constructors Methods
io.netty.channel

public Class DefaultChannelPromise

extends DefaultPromise<Void>
implements ChannelPromise, FlushCheckpoint
Class Inheritance
All Implemented Interfaces
io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint, io.netty.channel.ChannelPromise, io.netty.util.concurrent.Promise, io.netty.util.concurrent.Future, java.util.concurrent.Future, io.netty.channel.ChannelFuture
Known Direct Subclasses
io.netty.bootstrap.AbstractBootstrap.PendingRegistrationPromise, io.netty.channel.AbstractChannel.CloseFuture
Imports
io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint, io.netty.util.concurrent.DefaultPromise, .EventExecutor, .Future, .GenericFutureListener

The default ChannelPromise implementation. It is recommended to use Channel#newPromise() to create a new ChannelPromise rather than calling the constructor explicitly.

Field Summary

Modifier and TypeField and Description
private final Channel
private long

Constructor Summary

AccessConstructor and Description
public
DefaultChannelPromise(Channel
the Channel associated with this future
channel
)

Creates a new instance.

public
DefaultChannelPromise(Channel
the Channel associated with this future
channel
,
EventExecutor executor)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public ChannelPromise
public ChannelPromise
public ChannelPromise
public ChannelPromise
public Channel
channel()

Implements io.netty.channel.ChannelPromise.channel.

Returns a channel where the I/O operation associated with this future takes place.
protected void
protected EventExecutor
executor()

Overrides io.netty.util.concurrent.DefaultPromise.executor.

Get the executor used to notify listeners when this promise is complete.
public long
public void
public boolean
public ChannelPromise
public ChannelPromise
public ChannelPromise
public ChannelPromise
public ChannelPromise
public ChannelPromise
public ChannelPromise
sync()

Overrides io.netty.util.concurrent.DefaultPromise.sync.

Implements io.netty.channel.ChannelPromise.sync, io.netty.util.concurrent.Promise.sync, 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 ChannelPromise
public boolean
public ChannelPromise
unvoid()

Implements io.netty.channel.ChannelPromise.unvoid.

Returns a new ChannelPromise if isVoid() returns true otherwise itself.
Inherited from io.netty.util.concurrent.DefaultPromise:
awaitawaitawaitUninterruptiblyawaitUninterruptiblycancelcausegetgetgetNowisCancellableisCancelledisDoneisSuccessnotifyListenersetUncancellabletoStringtoStringBuildertryFailuretrySuccess

Field Detail

channelback to summary
private final Channel channel
checkpointback to summary
private long checkpoint

Constructor Detail

DefaultChannelPromiseback to summary
public DefaultChannelPromise(Channel channel)

Creates a new instance.

Parameters
channel:Channel

the Channel associated with this future

DefaultChannelPromiseback to summary
public DefaultChannelPromise(Channel channel, EventExecutor executor)

Creates a new instance.

Parameters
channel:Channel

the Channel associated with this future

Method Detail

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

Overrides io.netty.util.concurrent.DefaultPromise.addListener.

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

Overrides io.netty.util.concurrent.DefaultPromise.addListeners.

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

Overrides io.netty.util.concurrent.DefaultPromise.await.

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

Overrides io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly.

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

Implements io.netty.channel.ChannelPromise.channel.

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

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

Annotations
@Override
checkDeadLockback to summary
protected void checkDeadLock()

Overrides io.netty.util.concurrent.DefaultPromise.checkDeadLock.

Annotations
@Override
executorback to summary
protected EventExecutor executor()

Overrides io.netty.util.concurrent.DefaultPromise.executor.

Doc from io.netty.util.concurrent.DefaultPromise.executor.

Get the executor used to notify listeners when this promise is complete.

It is assumed this executor will protect against StackOverflowError exceptions. The executor may be used to avoid StackOverflowError by executing a Runnable if the stack depth exceeds a threshold.

Returns:EventExecutor

The executor used to notify listeners when this promise is complete.

Annotations
@Override
flushCheckpointback to summary
public long flushCheckpoint()

Implements io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint.flushCheckpoint.

Annotations
@Override
flushCheckpointback to summary
public void flushCheckpoint(long checkpoint)

Implements io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint.flushCheckpoint.

Annotations
@Override
isVoidback to summary
public boolean isVoid()

Implements io.netty.channel.ChannelFuture.isVoid.

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

Returns true if this ChannelFuture is a void future and so not allow to call any of the following methods:

Annotations
@Override
promiseback to summary
public ChannelPromise promise()

Implements io.netty.channel.ChannelFlushPromiseNotifier.FlushCheckpoint.promise.

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

Overrides io.netty.util.concurrent.DefaultPromise.removeListener.

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

Overrides io.netty.util.concurrent.DefaultPromise.removeListeners.

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

Overrides io.netty.util.concurrent.DefaultPromise.setFailure.

Implements io.netty.channel.ChannelPromise.setFailure, 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()

Implements io.netty.channel.ChannelPromise.setSuccess.

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

Overrides io.netty.util.concurrent.DefaultPromise.setSuccess.

Implements io.netty.channel.ChannelPromise.setSuccess, 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
syncback to summary
public ChannelPromise sync() throws InterruptedException

Overrides io.netty.util.concurrent.DefaultPromise.sync.

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

Overrides io.netty.util.concurrent.DefaultPromise.syncUninterruptibly.

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

Implements io.netty.channel.ChannelPromise.trySuccess.

Annotations
@Override
unvoidback to summary
public ChannelPromise unvoid()

Implements io.netty.channel.ChannelPromise.unvoid.

Doc from io.netty.channel.ChannelPromise.unvoid.

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

Annotations
@Override