Class ThreadUtilities

java.lang.Object
de.hybris.platform.util.ThreadUtilities

public final class ThreadUtilities extends Object
utility methods for Thread handling
  • Method Details

    • getAllThreads

      protected static Set getAllThreads()
    • getThreadCount

      public static int getThreadCount()
      get the number of threads, not limited by thread group or activity
    • getThreadCountMap

      public static Map getThreadCountMap()
      Returns:
      a map containing thread class Class -> instance count Integer
    • printThreadDump

      public static void printThreadDump(PrintStream out)
    • printThreadDump

      public static String printThreadDump()
    • getNumberOfThreadsFromExpression

      public static int getNumberOfThreadsFromExpression(String expression, int defaultValue)
      Evaluates an expression and returns its value. If expression can't be evaluated a given default value will be returned. In expression you can use #cores variable which holds number of cores. In case when expression evaluates to value lower than 1 value 1 will be returned.

      Examples of valid expressions:

      • 7
      • #cores
      • #cores * 2
      • #cores - 1

      Parameters:
      expression - expression to evaluate
      defaultValue - default value which must be greater than zero
      Returns:
      value of expression or default value
    • getNumberOfAvailableCores

      public static int getNumberOfAvailableCores()