Class DefaultCancellationTokenSource
- java.lang.Object
-
- org.gradle.tooling.internal.consumer.DefaultCancellationTokenSource
-
- All Implemented Interfaces:
CancellationTokenSource
public final class DefaultCancellationTokenSource extends java.lang.Object implements CancellationTokenSource
-
-
Constructor Summary
Constructors Constructor Description DefaultCancellationTokenSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Initiates cancel request.CancellationToken
token()
Returns a token associated with thisCancellationTokenSource
.
-
-
-
Method Detail
-
cancel
public void cancel()
Description copied from interface:CancellationTokenSource
Initiates cancel request. All operations that have been associated with this token will be cancelled.It is assumed that the implementation will do 'best-effort' attempt to perform cancellation. This method returns immediately and if the cancellation is successful the cancelled operation will notify its
ResultHandler.onFailure(GradleConnectionException)
with aBuildCancelledException
describing how it was cancelled.- Specified by:
cancel
in interfaceCancellationTokenSource
-
token
public CancellationToken token()
Description copied from interface:CancellationTokenSource
Returns a token associated with thisCancellationTokenSource
. Always returns the same instance.- Specified by:
token
in interfaceCancellationTokenSource
- Returns:
- The cancellation token.
-
-