Class ThreadUtils


  • public final class ThreadUtils
    extends java.lang.Object
    Auxiliary methods for thread processing.
    Since:
    1.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ThreadUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean silentSleep​(long milliseconds)
      Just suspend the current thread for defined interval in milliseconds.
      static int stackDepth()
      Get the stack call depth for the caller.
      static java.lang.StackTraceElement stackElement()
      Get the stack element of the method caller.
      • Methods inherited from class java.lang.Object

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

      • ThreadUtils

        private ThreadUtils()
    • Method Detail

      • silentSleep

        @Weight(VARIABLE)
        public static boolean silentSleep​(long milliseconds)
        Just suspend the current thread for defined interval in milliseconds.
        Parameters:
        milliseconds - milliseconds to sleep
        Returns:
        false if the sleep has been interrupted by InterruptedException, true otherwise.
        Since:
        1.0
        See Also:
        Thread.sleep(long)
      • stackElement

        @Weight(VARIABLE)
        public static java.lang.StackTraceElement stackElement()
        Get the stack element of the method caller.
        Returns:
        the stack trace element for the calling method.
        Since:
        1.0
      • stackDepth

        @Weight(VARIABLE)
        public static int stackDepth()
        Get the stack call depth for the caller.
        Returns:
        the caller method stack depth.
        Since:
        1.0