Class DefaultCancelFuture

    • Field Detail

      • backTrace

        private java.util.concurrent.CancellationException backTrace
    • Constructor Detail

      • DefaultCancelFuture

        protected DefaultCancelFuture​(java.lang.Object id)
    • Method Detail

      • verify

        public java.lang.Boolean verify​(long timeoutMillis,
                                        CancelOption... options)
                                 throws java.io.IOException
        Wait and verify that the operation was successful
        Specified by:
        verify in interface VerifiableFuture<java.lang.Boolean>
        Parameters:
        timeoutMillis - Wait timeout in milliseconds
        options - Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
        Returns:
        the value of isCanceled()
        Throws:
        java.io.IOException - If failed to verify successfully on time
      • setCanceled

        public void setCanceled()
        Description copied from interface: CancelFuture
        Marks this CancelFuture as the cancellation having been effected.

        This is a framework-internal method.

        Specified by:
        setCanceled in interface CancelFuture
      • setCanceled

        public void setCanceled​(java.lang.Throwable error)
        Description copied from interface: CancelFuture
        Marks this CancelFuture as the cancellation having been effected.

        This is a framework-internal method.

        Specified by:
        setCanceled in interface CancelFuture
        Parameters:
        error - optional Throwable, if non-null, it'll be attached to the backtrace.
      • setNotCanceled

        public void setNotCanceled()
        Description copied from interface: CancelFuture
        Completes this future with a value indicating that the cancellation was not done.
        Specified by:
        setNotCanceled in interface CancelFuture
      • isCanceled

        public boolean isCanceled()
        Description copied from interface: CancelFuture
        Tells whether the cancellation has been effected. (WaitableFuture.isDone() && !isCanceled()) means the cancellation was not effected. In that case check the original operation for a success or failure value.
        Specified by:
        isCanceled in interface CancelFuture
        Returns:
        true if the cancellation was done; false otherwise
      • setBackTrace

        public void setBackTrace​(java.util.concurrent.CancellationException backTrace)
        Description copied from interface: CancelFuture
        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.

        Specified by:
        setBackTrace in interface CancelFuture
        Parameters:
        backTrace - CancellationException to set
      • getBackTrace

        public java.util.concurrent.CancellationException getBackTrace()
        Description copied from interface: CancelFuture
        Obtains an exception describing the stack trace of where the cancellation was initiated.
        Specified by:
        getBackTrace in interface CancelFuture
        Returns:
        a CancellationException