Class BuildCancellationTokenAdapter
- java.lang.Object
-
- org.gradle.tooling.internal.consumer.parameters.BuildCancellationTokenAdapter
-
- All Implemented Interfaces:
InternalCancellationToken
public class BuildCancellationTokenAdapter extends java.lang.Object implements InternalCancellationToken
-
-
Constructor Summary
Constructors Constructor Description BuildCancellationTokenAdapter(org.gradle.initialization.BuildCancellationToken cancellationToken)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddCallback(java.lang.Runnable cancellationHandler)Adds a callback that will be executed when cancel event is triggered.booleanisCancellationRequested()voidremoveCallback(java.lang.Runnable cancellationHandler)Removes a callback from a set of handlers called when cancel is requested.
-
-
-
Method Detail
-
isCancellationRequested
public boolean isCancellationRequested()
- Specified by:
isCancellationRequestedin interfaceInternalCancellationToken
-
addCallback
public boolean addCallback(java.lang.Runnable cancellationHandler)
Description copied from interface:InternalCancellationTokenAdds a callback that will be executed when cancel event is triggered. It can be run synchronously if the token is already cancelled.- Specified by:
addCallbackin interfaceInternalCancellationToken- Returns:
- current state of cancellation request before callback was added.
-
removeCallback
public void removeCallback(java.lang.Runnable cancellationHandler)
Description copied from interface:InternalCancellationTokenRemoves a callback from a set of handlers called when cancel is requested.- Specified by:
removeCallbackin interfaceInternalCancellationToken- Parameters:
cancellationHandler- removed callback.
-
-