Package de.hybris.platform.util
Class ThreadUtilities
- java.lang.Object
-
- de.hybris.platform.util.ThreadUtilities
-
public final class ThreadUtilities extends java.lang.Objectutility methods for Thread handling
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static java.util.SetgetAllThreads()static intgetNumberOfAvailableCores()static intgetNumberOfThreadsFromExpression(java.lang.String expression, int defaultValue)Evaluates an expression and returns its value.static intgetThreadCount()get the number of threads, not limited by thread group or activitystatic java.util.MapgetThreadCountMap()static java.lang.StringprintThreadDump()static voidprintThreadDump(java.io.PrintStream out)
-
-
-
Method Detail
-
getAllThreads
protected static java.util.Set getAllThreads()
-
getThreadCount
public static int getThreadCount()
get the number of threads, not limited by thread group or activity
-
getThreadCountMap
public static java.util.Map getThreadCountMap()
- Returns:
- a map containing thread class
Class-> instance countInteger
-
printThreadDump
public static void printThreadDump(java.io.PrintStream out)
-
printThreadDump
public static java.lang.String printThreadDump()
-
getNumberOfThreadsFromExpression
public static int getNumberOfThreadsFromExpression(java.lang.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#coresvariable 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 evaluatedefaultValue- default value which must be greater than zero- Returns:
- value of expression or default value
-
getNumberOfAvailableCores
public static int getNumberOfAvailableCores()
-
-