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
    • Method Detail

      • 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,
                                    java.util.function.Supplier<java.lang.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:
        java.lang.RuntimeException - if the transaction has been terminated
      • terminate

        default void terminate()