Top Fields Constructors Methods
io.netty.channel

public final Class DelegatingChannelPromiseNotifier

extends Object
implements ChannelPromise, ChannelFutureListener
Class Inheritance
All Implemented Interfaces
io.netty.channel.ChannelFutureListener, io.netty.util.concurrent.GenericFutureListener, java.util.EventListener, io.netty.channel.ChannelPromise, io.netty.util.concurrent.Promise, io.netty.util.concurrent.Future, java.util.concurrent.Future, io.netty.channel.ChannelFuture
Annotations
@UnstableApi
Imports
io.netty.util.concurrent.Future, .GenericFutureListener, io.netty.util.internal.PromiseNotificationUtil, .UnstableApi, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.util.concurrent.ExecutionException, .TimeUnit, .TimeoutException

Field Summary

Modifier and TypeField and Description
private final ChannelPromise
private static final InternalLogger
private final boolean

Constructor Summary

AccessConstructor and Description
public
public
DelegatingChannelPromiseNotifier(ChannelPromise delegate, boolean logNotifyFailure)

Method Summary

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

Implements io.netty.channel.ChannelPromise.addListener.

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

Implements io.netty.channel.ChannelPromise.addListeners.

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

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

Implements io.netty.channel.ChannelPromise.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
true if the thread executing this task should be interrupted (if the thread is known to the implementation); otherwise, in-progress tasks are allowed to complete
mayInterruptIfRunning
)

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

Attempts to cancel execution of this task.
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 Channel
channel()

Implements io.netty.channel.ChannelPromise.channel.

Returns a channel where the I/O operation associated with this future takes place.
public Void
get()

Implements java.util.concurrent.Future.get.

Waits if necessary for the computation to complete, and then retrieves its result.
public Void
get(long
the maximum time to wait
timeout
,
TimeUnit
the time unit of the timeout argument
unit
)

Implements java.util.concurrent.Future.get.

Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
public Void
getNow()

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

Return the result without blocking.
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 boolean
isSuccess()

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

Returns true if and only if the I/O operation was completed successfully.
public boolean
public void
operationComplete(ChannelFuture
the source Future which called this callback
future
)

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Invoked when the operation associated with the Future has been completed.
public ChannelPromise
removeListener(GenericFutureListener<? extends Future<? super Void>> listener)

Implements io.netty.channel.ChannelPromise.removeListener.

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

Implements io.netty.channel.ChannelPromise.removeListeners.

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

Implements io.netty.channel.ChannelPromise.setFailure.

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

Implements io.netty.channel.ChannelPromise.setSuccess.

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

Implements io.netty.util.concurrent.Promise.setUncancellable.

Make this future impossible to cancel.
public ChannelPromise
sync()

Implements io.netty.channel.ChannelPromise.sync.

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

Implements io.netty.channel.ChannelPromise.syncUninterruptibly.

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

Implements io.netty.util.concurrent.Promise.tryFailure.

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

Implements io.netty.util.concurrent.Promise.trySuccess.

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

Implements io.netty.channel.ChannelPromise.unvoid.

Returns a new ChannelPromise if isVoid() returns true otherwise itself.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final ChannelPromise delegate
loggerback to summary
private static final InternalLogger logger
logNotifyFailureback to summary
private final boolean logNotifyFailure

Constructor Detail

DelegatingChannelPromiseNotifierback to summary
public DelegatingChannelPromiseNotifier(ChannelPromise delegate)
DelegatingChannelPromiseNotifierback to summary
public DelegatingChannelPromiseNotifier(ChannelPromise delegate, boolean logNotifyFailure)

Method Detail

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

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

Implements io.netty.channel.ChannelPromise.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

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

Implements io.netty.channel.ChannelPromise.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

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

true if the thread executing this task should be interrupted (if the thread is known to the implementation); otherwise, in-progress tasks are allowed to complete

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
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
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
getback to summary
public Void get() throws InterruptedException, ExecutionException

Implements java.util.concurrent.Future.get.

Doc from java.util.concurrent.Future.get.

Waits if necessary for the computation to complete, and then retrieves its result.

Returns:Void

the computed result

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted while waiting
ExecutionException:
if the computation threw an exception
getback to summary
public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException

Implements java.util.concurrent.Future.get.

Doc from java.util.concurrent.Future.get.

Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.

Parameters
timeout:long

the maximum time to wait

unit:TimeUnit

the time unit of the timeout argument

Returns:Void

the computed result

Annotations
@Override
Exceptions
InterruptedException:
if the current thread was interrupted while waiting
ExecutionException:
if the computation threw an exception
TimeoutException:
if the wait timed out
getNowback to summary
public Void 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
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
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
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
operationCompleteback to summary
public void operationComplete(ChannelFuture future) throws Exception

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Doc from io.netty.util.concurrent.GenericFutureListener.operationComplete.

Invoked when the operation associated with the Future has been completed.

Parameters
future:ChannelFuture

the source Future which called this callback

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

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

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

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

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

Implements io.netty.channel.ChannelPromise.setSuccess.

Annotations
@Override
setUncancellableback to summary
public boolean setUncancellable()

Implements io.netty.util.concurrent.Promise.setUncancellable.

Doc from io.netty.util.concurrent.Promise.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.

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

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

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

Implements io.netty.util.concurrent.Promise.tryFailure.

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

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.

Annotations
@Override
trySuccessback to summary
public boolean trySuccess()

Implements io.netty.channel.ChannelPromise.trySuccess.

Annotations
@Override
trySuccessback to summary
public boolean trySuccess(Void result)

Implements io.netty.util.concurrent.Promise.trySuccess.

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

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.

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