@InterfaceAudience.Private public class ReflectionUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static long |
previousLogTime |
private static ThreadMXBean |
threadBean |
Constructor and Description |
---|
ReflectionUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> Constructor<T> |
findConstructor(Class<T> type,
Object... paramTypes) |
private static String |
getTaskName(long id,
String name) |
private static <T> T |
instantiate(String className,
Constructor<T> ctor,
Object[] ctorArgs) |
static <T> T |
instantiateWithCustomCtor(String className,
Class<?>[] ctorArgTypes,
Object[] ctorArgs) |
static void |
logThreadInfo(org.apache.commons.logging.Log log,
String title,
long minInterval)
Log the current thread stacks at INFO level.
|
static <T> T |
newInstance(Class<T> type,
Object... params) |
private static void |
printThreadInfo(PrintStream stream,
String title)
Print all of the thread's information and stack traces.
|
private static long previousLogTime
private static final ThreadMXBean threadBean
public static <T> T instantiateWithCustomCtor(String className, Class<?>[] ctorArgTypes, Object[] ctorArgs)
private static <T> T instantiate(String className, Constructor<T> ctor, Object[] ctorArgs)
public static <T> Constructor<T> findConstructor(Class<T> type, Object... paramTypes)
public static void logThreadInfo(org.apache.commons.logging.Log log, String title, long minInterval)
log
- the logger that logs the stack tracetitle
- a descriptive title for the call stacksminInterval
- the minimum time from the lastprivate static void printThreadInfo(PrintStream stream, String title)
stream
- the stream totitle
- a string title for the stack traceCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.