Class EvaluationCleanup


  • class EvaluationCleanup
    extends java.lang.Object
    Handles how threads and thread-pools are cleanup after each conditional evaluation round. I.e. each call to until.
    Since:
    3.1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.function.Consumer<java.util.concurrent.ExecutorService> normalShutdownBehavior  
      private java.util.function.Consumer<java.util.concurrent.ExecutorService> unexpectedShutdownBehavior  
    • Constructor Summary

      Constructors 
      Constructor Description
      EvaluationCleanup​(java.util.function.Consumer<java.util.concurrent.ExecutorService> normalShutdownBehavior, java.util.function.Consumer<java.util.concurrent.ExecutorService> unexpectedShutdownBehavior)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void executeNormalCleanupBehavior​(java.util.concurrent.ExecutorService executorService)  
      (package private) void executeUnexpectedCleanupBehavior​(java.util.concurrent.ExecutorService executorService)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • normalShutdownBehavior

        private final java.util.function.Consumer<java.util.concurrent.ExecutorService> normalShutdownBehavior
      • unexpectedShutdownBehavior

        private final java.util.function.Consumer<java.util.concurrent.ExecutorService> unexpectedShutdownBehavior
    • Constructor Detail

      • EvaluationCleanup

        EvaluationCleanup​(java.util.function.Consumer<java.util.concurrent.ExecutorService> normalShutdownBehavior,
                          java.util.function.Consumer<java.util.concurrent.ExecutorService> unexpectedShutdownBehavior)
        Parameters:
        normalShutdownBehavior - The cleanup behavior that is executed when an until method call succeeds, fails or times out.
        unexpectedShutdownBehavior - The cleanup behavior that is executed for unexpected failures. Currently this means when exceptions are thrown from non-test threads ("uncaught exceptions")
    • Method Detail

      • executeNormalCleanupBehavior

        void executeNormalCleanupBehavior​(java.util.concurrent.ExecutorService executorService)
      • executeUnexpectedCleanupBehavior

        void executeUnexpectedCleanupBehavior​(java.util.concurrent.ExecutorService executorService)