Top Constructors Methods
io.netty.util.concurrent

public Class DefaultProgressivePromise<V>

extends DefaultPromise<V>
implements ProgressivePromise<V>
Class Inheritance
All Implemented Interfaces
io.netty.util.concurrent.ProgressivePromise, io.netty.util.concurrent.ProgressiveFuture, io.netty.util.concurrent.Future, java.util.concurrent.Future, io.netty.util.concurrent.Promise
Known Direct Subclasses
io.netty.util.concurrent.ImmediateEventExecutor.ImmediateProgressivePromise
Static Imports
io.netty.util.internal.ObjectUtil.checkPositiveOrZero

Constructor Summary

AccessConstructor and Description
public
DefaultProgressivePromise(EventExecutor
the EventExecutor which is used to notify the promise when it progresses or it is complete
executor
)

Creates a new instance.

protected

Method Summary

Modifier and TypeMethod and Description
public ProgressivePromise<V>
public ProgressivePromise<V>
public ProgressivePromise<V>
public ProgressivePromise<V>
public ProgressivePromise<V>
public ProgressivePromise<V>
public ProgressivePromise<V>
public ProgressivePromise<V>
setProgress(long progress, long total)

Implements io.netty.util.concurrent.ProgressivePromise.setProgress.

Sets the current progress of the operation and notifies the listeners that implement GenericProgressiveFutureListener.
public ProgressivePromise<V>
public ProgressivePromise<V>
sync()

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V>
public boolean
tryProgress(long progress, long total)

Implements io.netty.util.concurrent.ProgressivePromise.tryProgress.

Tries to set the current progress of the operation and notifies the listeners that implement GenericProgressiveFutureListener.
Inherited from io.netty.util.concurrent.DefaultPromise:
awaitawaitawaitUninterruptiblyawaitUninterruptiblycancelcausecheckDeadLockexecutorgetgetgetNowisCancellableisCancelledisDoneisSuccessnotifyListenernotifyProgressiveListenerssetUncancellabletoStringtoStringBuildertryFailuretrySuccess

Constructor Detail

DefaultProgressivePromiseback to summary
public DefaultProgressivePromise(EventExecutor executor)

Creates a new instance. It is preferable to use EventExecutor#newProgressivePromise() to create a new progressive promise

Parameters
executor:EventExecutor

the EventExecutor which is used to notify the promise when it progresses or it is complete

DefaultProgressivePromiseback to summary
protected DefaultProgressivePromise()

Method Detail

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

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V> addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V> await() throws InterruptedException

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V> awaitUninterruptibly()

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

Implements io.netty.util.concurrent.ProgressivePromise.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
removeListenerback to summary
public ProgressivePromise<V> removeListener(GenericFutureListener<? extends Future<? super V>> listener)

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V> removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V> setFailure(Throwable cause)

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

Implements io.netty.util.concurrent.ProgressivePromise.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
setProgressback to summary
public ProgressivePromise<V> setProgress(long progress, long total)

Implements io.netty.util.concurrent.ProgressivePromise.setProgress.

Doc from io.netty.util.concurrent.ProgressivePromise.setProgress.

Sets the current progress of the operation and notifies the listeners that implement GenericProgressiveFutureListener.

Annotations
@Override
setSuccessback to summary
public ProgressivePromise<V> setSuccess(V result)

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V> sync() throws InterruptedException

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

Implements io.netty.util.concurrent.ProgressivePromise.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 ProgressivePromise<V> syncUninterruptibly()

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

Implements io.netty.util.concurrent.ProgressivePromise.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
tryProgressback to summary
public boolean tryProgress(long progress, long total)

Implements io.netty.util.concurrent.ProgressivePromise.tryProgress.

Doc from io.netty.util.concurrent.ProgressivePromise.tryProgress.

Tries to set the current progress of the operation and notifies the listeners that implement GenericProgressiveFutureListener. If the operation is already complete or the progress is out of range, this method does nothing but returning false.

Annotations
@Override