public class CancellationToken extends Object
Constructor and Description |
---|
CancellationToken()
Creates a new instance of CancellationToken
|
CancellationToken(CancellationToken parentToken)
Creates a new instance of CancellationToken with parentToken specified.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the token.
|
boolean |
isCancelled()
Determines if the operation has to be cancelled.
|
static boolean |
isCancelled(CancellationToken token)
Allows to check if provided token is cancelled.
|
public CancellationToken()
public CancellationToken(CancellationToken parentToken)
parentToken
- The parent token.
If the parent token will be cancelled, this token will report as cancelled as well.public void cancel()
public boolean isCancelled()
public static boolean isCancelled(CancellationToken token)
token
- The token to check or null.Copyright © 2014. All Rights Reserved.