Class BuildCancellationTokenAdapter

    • Constructor Summary

      Constructors 
      Constructor Description
      BuildCancellationTokenAdapter​(org.gradle.initialization.BuildCancellationToken cancellationToken)  
    • Method Summary

      All Methods Instance Methods Concrete 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BuildCancellationTokenAdapter

        public BuildCancellationTokenAdapter​(org.gradle.initialization.BuildCancellationToken cancellationToken)
    • Method Detail

      • addCallback

        public boolean addCallback​(java.lang.Runnable cancellationHandler)
        Description copied from interface: InternalCancellationToken
        Adds a callback that will be executed when cancel event is triggered. It can be run synchronously if the token is already cancelled.
        Specified by:
        addCallback in interface InternalCancellationToken
        Returns:
        current state of cancellation request before callback was added.
      • removeCallback

        public void removeCallback​(java.lang.Runnable cancellationHandler)
        Description copied from interface: InternalCancellationToken
        Removes a callback from a set of handlers called when cancel is requested.
        Specified by:
        removeCallback in interface InternalCancellationToken
        Parameters:
        cancellationHandler - removed callback.