Package com.aspose.tasks
Class CancellationTokenSource
- java.lang.Object
-
- com.aspose.tasks.CancellationTokenSource
-
public class CancellationTokenSource extends Object
Signals to a `CancellationToken` that it should be canceled.
-
-
Constructor Summary
Constructors Constructor Description CancellationTokenSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
Communicates a request for cancellation.CancellationToken
getToken()
Creates the new `CancellationToken` associated with this `CancellationTokenSource`.boolean
isCancellationRequested()
Gets whether cancellation has been requested for this CancellationTokenSource.
-
-
-
Method Detail
-
getToken
public CancellationToken getToken()
Creates the new `CancellationToken` associated with this `CancellationTokenSource`.- Returns:
- a token associated with this `CancellationTokenSource`.
-
isCancellationRequested
public boolean isCancellationRequested()
Gets whether cancellation has been requested for this CancellationTokenSource.- Returns:
- true, if cancellation has been requested; false otherwise.
-
cancel
public void cancel()
Communicates a request for cancellation.
-
-