Class CustomCancellationToken
- java.lang.Object
-
- com.facilita.fc.runtime.backgroundScripting.CustomCancellationToken
-
public class CustomCancellationToken extends java.lang.ObjectThis is helper class to allow the background script to monitor cancellation requests from the main script (or VU) and signal back that it accepted cancellation.
-
-
Constructor Summary
Constructors Constructor Description CustomCancellationToken()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptCancellation()This is to be called by the background script when it finished with the current job and accepted the cancellation request.voidcancel()Used to initiate a cancellation request to the background script.booleanisCancellationAccepted()For internal use onlybooleanisCancellationRequested()Function to be regularly checked by the background script inside the loop to see if the cancellation was requested.
-
-
-
Method Detail
-
isCancellationRequested
public boolean isCancellationRequested()
Function to be regularly checked by the background script inside the loop to see if the cancellation was requested.- Returns:
trueif cancellation is requested
-
cancel
public void cancel()
Used to initiate a cancellation request to the background script.
-
acceptCancellation
public void acceptCancellation()
This is to be called by the background script when it finished with the current job and accepted the cancellation request.
-
isCancellationAccepted
public boolean isCancellationAccepted()
For internal use only- Returns:
- For internal use only
-
-