public final class VMStack extends Object
| Constructor and Description |
|---|
VMStack() |
| Modifier and Type | Method and Description |
|---|---|
static int |
fillStackTraceElements(Thread t,
StackTraceElement[] stackTraceElements)
Retrieves a partial stack trace from the specified thread into
the provided array.
|
static ClassLoader |
getCallingClassLoader()
Returns the defining class loader of the caller's caller.
|
static ClassLoader |
getClosestUserClassLoader()
Returns the first ClassLoader on the call stack that isn't the
bootstrap class loader.
|
static Class<?> |
getStackClass1()
Returns the class of the caller's caller.
|
static Class<?> |
getStackClass2()
Returns the class of the caller's caller's caller.
|
static StackTraceElement[] |
getThreadStackTrace(Thread t)
Retrieves the stack trace from the specified thread.
|
public static ClassLoader getCallingClassLoader()
null if this is the
bootstrap class loader.public static Class<?> getStackClass1()
null.public static Class<?> getStackClass2()
null.public static ClassLoader getClosestUserClassLoader()
public static StackTraceElement[] getThreadStackTrace(Thread t)
t - thread of interestpublic static int fillStackTraceElements(Thread t, StackTraceElement[] stackTraceElements)
t - thread of intereststackTraceElements - preallocated array for use when only the top of stack is
desired. Unused elements will be filled with null values.