Interface CancelCheck

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void check()
      Check if cancellation point is valid; It throws an exception in case if the cancellation point has been canceled.
      default void check​(java.util.function.Consumer<java.lang.Exception> handler)
      Check if cancellation point is valid, and handle the exception if it's not.
      java.lang.String getCancellationMessage()
      Returns null if the process has not been cancelled, otherwise the cancellation cause (if set).
      boolean isCancelled()  
      default <T extends java.lang.Exception>
      void
      throwIfCancelled​(java.util.function.Function<java.lang.String,​T> theThrower)  
    • Field Detail

      • DO_NOT_CLOSE

        static final java.lang.Runnable DO_NOT_CLOSE
    • Method Detail

      • check

        void check()
        Check if cancellation point is valid; It throws an exception in case if the cancellation point has been canceled.
      • check

        default void check​(java.util.function.Consumer<java.lang.Exception> handler)
        Check if cancellation point is valid, and handle the exception if it's not.
        Parameters:
        handler - exception handler
      • isCancelled

        boolean isCancelled()
        Returns:
        true if point has been cancelled, false otherwise;
      • getCancellationMessage

        @Nullable
        java.lang.String getCancellationMessage()
        Returns null if the process has not been cancelled, otherwise the cancellation cause (if set).
      • throwIfCancelled

        default <T extends java.lang.Exception> void throwIfCancelled​(java.util.function.Function<java.lang.String,​T> theThrower)
                                                               throws T extends java.lang.Exception
        Throws:
        T extends java.lang.Exception