|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.classpath.VMStackWalker
public final class VMStackWalker
Constructor Summary | |
---|---|
VMStackWalker()
|
Method Summary | |
---|---|
static ClassLoader |
firstNonNullClassLoader()
Walk up the stack and return the first non- null class loader. |
static Class<?> |
getCallingClass()
Classpath's Javadoc for this method is: Get the class associated with the method invoking the method invoking this method, or null if the stack is not
that deep (e.g., invoked via JNI invocation API). |
static Class<?> |
getCallingClass(int skip)
|
static ClassLoader |
getCallingClassLoader()
Classpath's Javadoc for this method is: Get the class loader associated with the Class returned by getCallingClass() , or null if no
such class exists or it is the boot loader. |
static Class<?>[] |
getClassContext()
Classpath's Javadoc for this method says: Get a list of all the classes currently executing methods on the Java stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VMStackWalker()
Method Detail |
---|
public static ClassLoader firstNonNullClassLoader()
null
class loader.
If there aren't any non-null
class loaders on the stack, return
null
.
null
classloader on stack or null
public static Class<?>[] getClassContext()
Get a list of all the classes currently executing methods on the Java stack.getClassContext()[0]
is the class associated with the currently executing method, i.e., the method that calledVMStackWalker.getClassContext()
(possibly through reflection). So you may need to pop off these stack frames from the top of the stack:
VMStackWalker.getClassContext()
Method.invoke()
- Returns:
- an array of the declaring classes of each stack frame
public static Class<?> getCallingClass()
Get the class associated with the method invoking the method invoking this method, ornull
if the stack is not that deep (e.g., invoked via JNI invocation API). This method is an optimization for the expressiongetClassContext()[1]
and should return the same result.VM implementers are encouraged to provide a more efficient version of this method.
public static Class<?> getCallingClass(int skip)
public static ClassLoader getCallingClassLoader()
Get the class loader associated with the Class returned bygetCallingClass()
, ornull
if no such class exists or it is the boot loader. This method is an optimization for the expressiongetClassContext()[1].getClassLoader()
and should return the same result.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |