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

public abstract Class DefaultCancellableSshFuture<T extends SshFuture<T>>

extends DefaultVerifiableSshFuture<T extends SshFuture<T>>
implements Cancellable
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.future.Cancellable, org.apache.sshd.common.future.WithException, org.apache.sshd.common.future.HasException
Known Direct Subclasses
org.apache.sshd.common.io.DefaultIoConnectFuture
Type Parameters
<T>
Type of future
Imports
java.util.Objects, java.util.concurrent.CancellationException

A default Cancellable future implementation.
Author
Apache MINA SSHD Project

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public CancelFuture
cancel()

Implements org.apache.sshd.common.future.Cancellable.cancel.

Attempts to cancel the operation.

protected CancelFuture
public CancelFuture
public Throwable
getException()

Implements org.apache.sshd.common.future.HasException.getException.

Returns the cause of the failure.

public boolean
isCanceled()

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

Tells whether this operation was canceled.

public void
setException(Throwable
The Throwable to set; must be non-null
exception
)

Implements org.apache.sshd.common.future.WithException.setException.

Sets the exception that caused the operation to fail.

Constructor Detail

DefaultCancellableSshFutureback to summary
protected DefaultCancellableSshFuture(Object id, Object lock)

Method Detail

cancelback to summary
public CancelFuture cancel()

Implements org.apache.sshd.common.future.Cancellable.cancel.

Doc from org.apache.sshd.common.future.Cancellable.cancel.

Attempts to cancel the operation.

Returns:CancelFuture

A CancelFuture that can be used to wait for the cancellation to have been effected, or null if the future cannot be canceled or is already completed.

Annotations
@Override
createCancellationback to summary
protected CancelFuture createCancellation()

Overrides org.apache.sshd.common.future.DefaultSshFuture.createCancellation.

Doc from org.apache.sshd.common.future.DefaultSshFuture.createCancellation.

Creates a CancelFuture if this future can be canceled.

This doesn't cancel this future yet.

Returns:CancelFuture

A CancelFuture that can be used to wait for the cancellation to have been effected, or null if the future cannot be canceled.

Annotations
@Override
getCancellationback to summary
public CancelFuture getCancellation()

Implements org.apache.sshd.common.future.Cancellable.getCancellation.

Doc from org.apache.sshd.common.future.Cancellable.getCancellation.

Retrieves the CancelFuture, if cancel() had been called.

Returns:CancelFuture

The CancelFuture if the Cancellable has already been canceled, or null otherwise

Annotations
@Override
getExceptionback to summary
public Throwable getException()

Implements org.apache.sshd.common.future.HasException.getException.

Doc from org.apache.sshd.common.future.HasException.getException.

Returns the cause of the failure.

Returns:Throwable

the Throwable of the failure, or null if not failed (yet).

Annotations
@Override
isCanceledback to summary
public boolean isCanceled()

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

Doc from org.apache.sshd.common.future.Cancellable.isCanceled.

Tells whether this operation was canceled.

Returns:boolean

true if the operation was cancelled, false otherwise.

Annotations
@Override
setExceptionback to summary
public void setException(Throwable exception)

Implements org.apache.sshd.common.future.WithException.setException.

Doc from org.apache.sshd.common.future.WithException.setException.

Sets the exception that caused the operation to fail. If the exception cannot be set but the future is already canceled, the exception will be reported through this future's CancelFuture.

Parameters
exception:Throwable

The Throwable to set; must be non-null

Annotations
@Override