Class CancellationFlag
java.lang.Object
org.jboss.as.ejb3.component.interceptors.CancellationFlag
An invocation cancellation flag.
- Author:
- David M. Lloyd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean setFlag) Attempt to cancel the corresponding invocation.booleanDetermine if the cancel flag was set.booleanDetermine if the request was cancelled before it could complete.booleanAttempt to determine whether the invocation should proceed or whether it should be cancelled.
-
Constructor Details
-
CancellationFlag
public CancellationFlag()Construct a new instance.
-
-
Method Details
-
cancel
public boolean cancel(boolean setFlag) Attempt to cancel the corresponding invocation.- Parameters:
setFlag-trueto set the Jakarta Enterprise Beans context cancellation flag (or equivalent),falseotherwise- Returns:
trueif the invocation was definitely cancelled, orfalseif it was not cancelled or it could not be determined if it was cancelled
-
runIfNotCancelled
public boolean runIfNotCancelled()Attempt to determine whether the invocation should proceed or whether it should be cancelled. This method should only be called once per flag instance.- Returns:
trueif the invocation should proceed, orfalseif it was cancelled
-
isCancelFlagSet
public boolean isCancelFlagSet()Determine if the cancel flag was set.- Returns:
trueif the flag was set,falseotherwise
-
isCancelled
public boolean isCancelled()Determine if the request was cancelled before it could complete.- Returns:
trueif the request was cancelled,falseotherwise
-