public abstract class WaarpCompletedFuture extends WaarpFuture
Modifier | Constructor and Description |
---|---|
protected |
WaarpCompletedFuture() |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitOrInterruptible() |
boolean |
awaitOrInterruptible(long timeoutMilliseconds) |
boolean |
awaitOrInterruptible(long timeout,
TimeUnit unit) |
boolean |
cancel()
Cancels the operation associated with this future and notifies all
listeners if canceled successfully.
|
boolean |
isCancelled()
Returns
true if and only if this future was canceled by a WaarpFuture.cancel() method. |
boolean |
isDone()
Returns
true if and only if this future is complete, regardless
of
whether the operation was
successful, failed, or canceled. |
void |
reset()
Experimental: try to re-enable the future
|
boolean |
setFailure(Throwable cause)
Marks this future as a failure and notifies all listeners.
|
boolean |
setSuccess()
Marks this future as a success and notifies all listeners.
|
getCause, isFailed, isSuccess, rethrowIfFailed
public boolean awaitOrInterruptible()
awaitOrInterruptible
in class WaarpFuture
public boolean awaitOrInterruptible(long timeoutMilliseconds)
awaitOrInterruptible
in class WaarpFuture
public boolean awaitOrInterruptible(long timeout, TimeUnit unit)
awaitOrInterruptible
in class WaarpFuture
public void reset()
WaarpFuture
reset
in class WaarpFuture
public boolean isDone()
WaarpFuture
true
if and only if this future is complete, regardless
of
whether the operation was
successful, failed, or canceled.isDone
in class WaarpFuture
public boolean setFailure(Throwable cause)
WaarpFuture
setFailure
in class WaarpFuture
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.public boolean setSuccess()
WaarpFuture
setSuccess
in class WaarpFuture
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.public boolean cancel()
WaarpFuture
cancel
in class WaarpFuture
true
if and only if the operation has been canceled.
false
if the operation can't
be canceled or is already completed.public boolean isCancelled()
WaarpFuture
true
if and only if this future was canceled by a WaarpFuture.cancel()
method.isCancelled
in class WaarpFuture
Copyright © 2009–2020 Waarp. All rights reserved.