Interface CancellationToken

  • All Implemented Interfaces:

    
    public interface CancellationToken
    
                        

    Propagates notification that operations should be canceled.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Boolean isCancellationRequested() Returns whether cancellation was requested from the source.
      abstract CancellationToken register(Runnable runnable) Registers a runnable that will be called when this CancellationToken is canceled.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • register

         abstract CancellationToken register(Runnable runnable)

        Registers a runnable that will be called when this CancellationToken is canceled. If this token is already in the canceled state, the runnable will be run immediately and synchronously.

        Parameters:
        runnable - the runnable to be run when the token is cancelled.
        Returns:

        a CancellationToken object.