Class CancellationFlag

java.lang.Object
org.jboss.as.ejb3.component.interceptors.CancellationFlag

public final class CancellationFlag extends Object
An invocation cancellation flag.
Author:
David M. Lloyd
  • 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 - true to set the Jakarta Enterprise Beans context cancellation flag (or equivalent), false otherwise
      Returns:
      true if the invocation was definitely cancelled, or false if 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:
      true if the invocation should proceed, or false if it was cancelled
    • isCancelFlagSet

      public boolean isCancelFlagSet()
      Determine if the cancel flag was set.
      Returns:
      true if the flag was set, false otherwise
    • isCancelled

      public boolean isCancelled()
      Determine if the request was cancelled before it could complete.
      Returns:
      true if the request was cancelled, false otherwise