public class DefaultProgressivePromise<V> extends DefaultPromise<V> implements ProgressivePromise<V>
Modifier | Constructor and Description |
---|---|
protected |
DefaultProgressivePromise() |
|
DefaultProgressivePromise(EventExecutor executor)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
ProgressivePromise<V> |
addListener(GenericFutureListener<? extends Future<? super V>> listener)
Adds the specified listener to this future.
|
ProgressivePromise<V> |
addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Adds the specified listeners to this future.
|
ProgressivePromise<V> |
await()
Waits for this future to be completed.
|
ProgressivePromise<V> |
awaitUninterruptibly()
Waits for this future to be completed without
interruption.
|
ProgressivePromise<V> |
removeListener(GenericFutureListener<? extends Future<? super V>> listener)
Removes the first occurrence of the specified listener from this future.
|
ProgressivePromise<V> |
removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Removes the first occurrence for each of the listeners from this future.
|
ProgressivePromise<V> |
setFailure(Throwable cause)
Marks this future as a failure and notifies all
listeners.
|
ProgressivePromise<V> |
setProgress(long progress,
long total)
Sets the current progress of the operation and notifies the listeners that implement
GenericProgressiveFutureListener . |
ProgressivePromise<V> |
setSuccess(V result)
Marks this future as a success and notifies all
listeners.
|
ProgressivePromise<V> |
sync()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
ProgressivePromise<V> |
syncUninterruptibly()
Waits for this future until it is done, and rethrows the cause of the failure if this future
failed.
|
boolean |
tryProgress(long progress,
long total)
Tries to set the current progress of the operation and notifies the listeners that implement
GenericProgressiveFutureListener . |
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, checkDeadLock, executor, get, get, getNow, isCancellable, isCancelled, isDone, isSuccess, notifyListener, setUncancellable, toString, toStringBuilder, tryFailure, trySuccess
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setUncancellable, tryFailure, trySuccess
await, await, awaitUninterruptibly, awaitUninterruptibly, cancel, cause, getNow, isCancellable, isSuccess
get, get, isCancelled, isDone
public DefaultProgressivePromise(EventExecutor executor)
EventExecutor.newProgressivePromise()
to create a new progressive promiseexecutor
- the EventExecutor
which is used to notify the promise when it progresses or it is completeprotected DefaultProgressivePromise()
public ProgressivePromise<V> setProgress(long progress, long total)
ProgressivePromise
GenericProgressiveFutureListener
.setProgress
in interface ProgressivePromise<V>
public boolean tryProgress(long progress, long total)
ProgressivePromise
GenericProgressiveFutureListener
. If the operation is already complete or the progress is out of range,
this method does nothing but returning false
.tryProgress
in interface ProgressivePromise<V>
public ProgressivePromise<V> addListener(GenericFutureListener<? extends Future<? super V>> listener)
Future
addListener
in interface ProgressiveFuture<V>
addListener
in interface ProgressivePromise<V>
addListener
in interface Promise<V>
addListener
in class DefaultPromise<V>
public ProgressivePromise<V> addListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Future
addListeners
in interface ProgressiveFuture<V>
addListeners
in interface ProgressivePromise<V>
addListeners
in interface Promise<V>
addListeners
in class DefaultPromise<V>
public ProgressivePromise<V> removeListener(GenericFutureListener<? extends Future<? super V>> listener)
Future
removeListener
in interface ProgressiveFuture<V>
removeListener
in interface ProgressivePromise<V>
removeListener
in interface Promise<V>
removeListener
in class DefaultPromise<V>
public ProgressivePromise<V> removeListeners(GenericFutureListener<? extends Future<? super V>>... listeners)
Future
removeListeners
in interface ProgressiveFuture<V>
removeListeners
in interface ProgressivePromise<V>
removeListeners
in interface Promise<V>
removeListeners
in class DefaultPromise<V>
public ProgressivePromise<V> sync() throws InterruptedException
Future
sync
in interface ProgressiveFuture<V>
sync
in interface ProgressivePromise<V>
sync
in interface Promise<V>
sync
in class DefaultPromise<V>
InterruptedException
public ProgressivePromise<V> syncUninterruptibly()
Future
syncUninterruptibly
in interface ProgressiveFuture<V>
syncUninterruptibly
in interface ProgressivePromise<V>
syncUninterruptibly
in interface Promise<V>
syncUninterruptibly
in class DefaultPromise<V>
public ProgressivePromise<V> await() throws InterruptedException
Future
await
in interface ProgressiveFuture<V>
await
in interface ProgressivePromise<V>
await
in interface Promise<V>
await
in class DefaultPromise<V>
InterruptedException
- if the current thread was interruptedpublic ProgressivePromise<V> awaitUninterruptibly()
Future
InterruptedException
and
discards it silently.awaitUninterruptibly
in interface ProgressiveFuture<V>
awaitUninterruptibly
in interface ProgressivePromise<V>
awaitUninterruptibly
in interface Promise<V>
awaitUninterruptibly
in class DefaultPromise<V>
public ProgressivePromise<V> setSuccess(V result)
Promise
IllegalStateException
.setSuccess
in interface ProgressivePromise<V>
setSuccess
in interface Promise<V>
setSuccess
in class DefaultPromise<V>
public ProgressivePromise<V> setFailure(Throwable cause)
Promise
IllegalStateException
.setFailure
in interface ProgressivePromise<V>
setFailure
in interface Promise<V>
setFailure
in class DefaultPromise<V>
Copyright © 2008–2024 The Netty Project. All rights reserved.