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 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
public boolean isCancellationRequested()
- Specified by:
isCancellationRequested
in interfaceInternalCancellationToken
-
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 interfaceInternalCancellationToken
- 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 interfaceInternalCancellationToken
- Parameters:
cancellationHandler
- removed callback.
-
-