public class InterruptionToken extends java.lang.Object implements IInterruptionToken
This class represents the token to use for signaling long running tasks whether the interruption was requested.
Modifier and Type | Method and Description |
---|---|
static InterruptionToken |
getNone()
Represents an empty interruption token.
|
boolean |
isInterruptionRequested()
Returns
bool.True if interruption was requested. |
void |
throwIfInterruptionRequested()
Throws an if
interruption was requested.
|
public static InterruptionToken getNone()
Represents an empty interruption token.
InterruptionTokenSource.interrupt()
when using this token.public final boolean isInterruptionRequested()
Returns bool.True
if interruption was requested.
isInterruptionRequested
in interface IInterruptionToken
public final void throwIfInterruptionRequested()
Throws an if interruption was requested.
throwIfInterruptionRequested
in interface IInterruptionToken
com.aspose.ms.System.OperationCanceledException
- OperationCanceledExceptioncom.aspose.ms.System.OperationCanceledException
- Thrown when interruption was requested.