Interface TerminationFlag

All Known Implementing Classes:
TerminationFlagImpl
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TerminationFlag
  • Field Details

  • Method Details

    • wrap

      static TerminationFlag wrap(TerminationMonitor terminationMonitor)
      Creates a new termination flag.
      Parameters:
      terminationMonitor - used to signal that the execution stopped running
    • wrap

      static TerminationFlag wrap(TerminationMonitor terminationMonitor, Supplier<RuntimeException> terminationCause)
      Creates a new termination flag.
      Parameters:
      terminationMonitor - used to signal that the execution stopped running
      terminationCause - returns a RuntimeException that is thrown when the execution is terminated
    • running

      boolean running()
    • assertRunning

      default void assertRunning()
      Throws:
      RuntimeException - if the transaction has been terminated
    • terminate

      default void terminate()