Top Description Methods
org.apache.sshd.common.future

public Interface CancelFuture

extends SshFuture<CancelFuture>, VerifiableFuture<Boolean>
Known Direct Implementers
org.apache.sshd.common.future.DefaultCancelFuture
Imports
java.util.concurrent.CancellationException

Cancellations may not always be effective immediately. While a cancelled 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.

Author
Apache MINA SSHD Project
See Also
Cancellable

Method Summary

Modifier and TypeMethod and Description
public CancellationException
getBackTrace()

Obtains an exception describing the stack trace of where the cancellation was initiated.

public boolean

Returns:

true if the cancellation was done; false otherwise
isCanceled
()

Tells whether the cancellation has been effected.

public void
setBackTrace(CancellationException backTrace)

Sets a CancellationException describing the stack trace of where the cancellation was initiated.

public void
setCanceled()

Marks this CancelFuture as the cancellation having been effected.

public void
setCanceled(Throwable
optional Throwable, if non-null, it'll be attached to the backtrace.
error
)

Marks this CancelFuture as the cancellation having been effected.

public void
setNotCanceled()

Completes this future with a value indicating that the cancellation was not done.

Inherited from org.apache.sshd.common.future.SshFuture:
addListenerremoveListener
Inherited from org.apache.sshd.common.future.VerifiableFuture:
verifyverifyverifyverifyverifyverifyverifyverify

Method Detail

getBackTraceback to summary
public CancellationException getBackTrace()

Obtains an exception describing the stack trace of where the cancellation was initiated.

Returns:CancellationException

a CancellationException

isCanceledback to summary
public boolean isCanceled()

Tells whether the cancellation has been effected. (isDone() && !isCanceled()) means the cancellation was not effected. In that case check the original operation for a success or failure value.

Returns:boolean

true if the cancellation was done; false otherwise

setBackTraceback to summary
public void setBackTrace(CancellationException backTrace)

Sets a 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.

Parameters
backTrace:CancellationException

CancellationException to set

setCanceledback to summary
public void setCanceled()

Marks this CancelFuture as the cancellation having been effected.

This is a framework-internal method.

setCanceledback to summary
public void setCanceled(Throwable error)

Marks this CancelFuture as the cancellation having been effected.

This is a framework-internal method.

Parameters
error:Throwable

optional Throwable, if non-null, it'll be attached to the backtrace.

setNotCanceledback to summary
public void setNotCanceled()

Completes this future with a value indicating that the cancellation was not done.