public interface CancelFuture extends SshFuture<CancelFuture>, VerifiableFuture<Boolean>
Cancellable future is considered
canceled immediately, it may take some time until the underlying asynchronous operation is really canceled. A
cancellation through Cancellable.cancel() returns a CancelFuture that can be used to wait for the
cancellation to have been effected.
A CancelFuture is not cancellable itself.
Cancellable| Modifier and Type | Method and Description |
|---|---|
CancellationException |
getBackTrace()
Obtains an exception describing the stack trace of where the cancellation was initiated.
|
boolean |
isCanceled()
Tells whether the cancellation has been effected.
|
void |
setBackTrace(CancellationException backTrace)
Sets a
CancellationException describing the stack trace of where the cancellation was initiated. |
void |
setCanceled()
Marks this
CancelFuture as the cancellation having been effected. |
void |
setCanceled(Throwable error)
Marks this
CancelFuture as the cancellation having been effected. |
void |
setNotCanceled()
Completes this future with a value indicating that the cancellation was not done.
|
addListener, removeListenerawait, await, await, await, await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDoneCancellationException getBackTrace()
CancellationExceptionboolean isCanceled()
WaitableFuture.isDone() && !isCanceled()) means the
cancellation was not effected. In that case check the original operation for a success or failure value.true if the cancellation was done; false otherwisevoid setCanceled()
CancelFuture as the cancellation having been effected.
This is a framework-internal method.
void setCanceled(Throwable error)
CancelFuture as the cancellation having been effected.
This is a framework-internal method.
error - optional Throwable, if non-null, it'll be attached to the backtrace.void setBackTrace(CancellationException backTrace)
CancellationException describing the stack trace of where the cancellation was initiated. Has no
effect if a backtrace was already set, or the given backtrace is null.
This is a framework-internal method.
backTrace - CancellationException to setvoid setNotCanceled()
Copyright © 2018–2024 The Apache Software Foundation. All rights reserved.