Interface InternalCancellationToken

  • All Known Implementing Classes:
    BuildCancellationTokenAdapter

    public interface InternalCancellationToken
    Cancellation token passed from consumer to provider to propagate cancellation events.
    Since:
    2.1-rc-1
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean addCallback​(java.lang.Runnable cancellationHandler)
      Adds a callback that will be executed when cancel event is triggered.
      boolean isCancellationRequested()  
      void removeCallback​(java.lang.Runnable cancellationHandler)
      Removes a callback from a set of handlers called when cancel is requested.
    • Method Detail

      • isCancellationRequested

        boolean isCancellationRequested()
      • addCallback

        boolean addCallback​(java.lang.Runnable cancellationHandler)
        Adds a callback that will be executed when cancel event is triggered. It can be run synchronously if the token is already cancelled.
        Parameters:
        cancellationHandler -
        Returns:
        current state of cancellation request before callback was added.
      • removeCallback

        void removeCallback​(java.lang.Runnable cancellationHandler)
        Removes a callback from a set of handlers called when cancel is requested.
        Parameters:
        cancellationHandler - removed callback.