Interface Cancellable

All Superinterfaces:
WithException
All Known Subinterfaces:
AuthFuture, ConnectFuture, IoConnectFuture, OpenFuture
All Known Implementing Classes:
DefaultAuthFuture, DefaultCancellableSshFuture, DefaultConnectFuture, DefaultIoConnectFuture, DefaultOpenFuture

public interface Cancellable extends WithException
Some operation that can be cancelled.

Classes implementing this interface that support state listeners are expected to notify the listeners when cancel() changes the state of the operation.

  • Method Details

    • cancel

      CancelFuture cancel()
      Attempts to cancel the operation.
      Returns:
      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.
    • isCanceled

      boolean isCanceled()
      Tells whether this operation was canceled.
      Returns:
      true if the operation was cancelled, false otherwise.
    • getCancellation

      CancelFuture getCancellation()
      Retrieves the CancelFuture, if cancel() had been called.
      Returns:
      The CancelFuture if the Cancellable has already been canceled, or null otherwise