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

public Class DefaultCancelFuture

extends DefaultSshFuture<CancelFuture>
implements CancelFuture
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.future.CancelFuture, org.apache.sshd.common.future.VerifiableFuture, org.apache.sshd.common.future.SshFuture, org.apache.sshd.common.future.WaitableFuture
Imports
java.io.IOException, java.util.Objects, java.util.concurrent.CancellationException

A default implementation of a CancelFuture.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private CancellationException

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public CancellationException
getBackTrace()

Implements org.apache.sshd.common.future.CancelFuture.getBackTrace.

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

public boolean
isCanceled()

Implements org.apache.sshd.common.future.CancelFuture.isCanceled.

Tells whether the cancellation has been effected.

public void
setBackTrace(CancellationException backTrace)

Implements org.apache.sshd.common.future.CancelFuture.setBackTrace.

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

public void
setCanceled()

Implements org.apache.sshd.common.future.CancelFuture.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
)

Implements org.apache.sshd.common.future.CancelFuture.setCanceled.

Marks this CancelFuture as the cancellation having been effected.

public void
setNotCanceled()

Implements org.apache.sshd.common.future.CancelFuture.setNotCanceled.

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

public Boolean

Returns:

the value of isCanceled()
verify
(long
Wait timeout in milliseconds
timeoutMillis
,
CancelOption...
Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
options
)

Implements org.apache.sshd.common.future.VerifiableFuture.verify.

Wait and verify that the operation was successful

Inherited from org.apache.sshd.common.future.DefaultSshFuture:
addListenerawait0createCancellationgetNumRegisteredListenersgetValueisDonenotifyListenersonValueSetremoveListenersetValuetoString

Field Detail

backTraceback to summary
private CancellationException backTrace

Constructor Detail

DefaultCancelFutureback to summary
protected DefaultCancelFuture(Object id)

Method Detail

getBackTraceback to summary
public CancellationException getBackTrace()

Implements org.apache.sshd.common.future.CancelFuture.getBackTrace.

Doc from org.apache.sshd.common.future.CancelFuture.getBackTrace.

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

Returns:CancellationException

a CancellationException

Annotations
@Override
isCanceledback to summary
public boolean isCanceled()

Implements org.apache.sshd.common.future.CancelFuture.isCanceled.

Doc from org.apache.sshd.common.future.CancelFuture.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

Annotations
@Override
setBackTraceback to summary
public void setBackTrace(CancellationException backTrace)

Implements org.apache.sshd.common.future.CancelFuture.setBackTrace.

Doc from org.apache.sshd.common.future.CancelFuture.setBackTrace.

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

Annotations
@Override
setCanceledback to summary
public void setCanceled()

Implements org.apache.sshd.common.future.CancelFuture.setCanceled.

Doc from org.apache.sshd.common.future.CancelFuture.setCanceled.

Marks this CancelFuture as the cancellation having been effected.

This is a framework-internal method.

Annotations
@Override
setCanceledback to summary
public void setCanceled(Throwable error)

Implements org.apache.sshd.common.future.CancelFuture.setCanceled.

Doc from org.apache.sshd.common.future.CancelFuture.setCanceled.

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.

Annotations
@Override
setNotCanceledback to summary
public void setNotCanceled()

Implements org.apache.sshd.common.future.CancelFuture.setNotCanceled.

Doc from org.apache.sshd.common.future.CancelFuture.setNotCanceled.

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

Annotations
@Override
verifyback to summary
public Boolean verify(long timeoutMillis, CancelOption... options) throws IOException

Implements org.apache.sshd.common.future.VerifiableFuture.verify.

Doc from org.apache.sshd.common.future.VerifiableFuture.verify.

Wait and verify that the operation was successful

Parameters
timeoutMillis:long

Wait timeout in milliseconds

options:CancelOption[]

Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.

Returns:Boolean

the value of isCanceled()

Annotations
@Override
Exceptions
IOException:
If failed to verify successfully on time