Class ThreadHelper


  • public final class ThreadHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void runWithTimeout​(java.lang.Runnable runnable, long timeout, java.util.concurrent.TimeUnit timeUnit)  
      static <RETURN_TYPE>
      RETURN_TYPE
      runWithTimeout​(java.util.concurrent.Callable<RETURN_TYPE> callable, long timeout, java.util.concurrent.TimeUnit timeUnit)  
      • Methods inherited from class java.lang.Object

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

      • runWithTimeout

        public static <RETURN_TYPE> RETURN_TYPE runWithTimeout​(java.util.concurrent.Callable<RETURN_TYPE> callable,
                                                               long timeout,
                                                               java.util.concurrent.TimeUnit timeUnit)
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • runWithTimeout

        public static void runWithTimeout​(java.lang.Runnable runnable,
                                          long timeout,
                                          java.util.concurrent.TimeUnit timeUnit)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception