public final class StackInspector extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
callStackContains(Class<?> clazz)
Determine whether the call stack contains a given class.
|
Class<?> |
getCallerClass(int skipFrames)
Get the caller class.
|
Class<?>[] |
getCallStack()
Get the call stack.
|
Class<?>[] |
getCallStack(int skipFrames)
Get all or a portion of the call stack.
|
Class<?>[] |
getCallStack(int skipFrames,
int numFrames)
Get all or a portion of the call stack.
|
static StackInspector |
getInstance()
Get the singleton
StackInspector instance. |
public static StackInspector getInstance()
StackInspector
instance. The caller must have the getStackInspector
RuntimePermission
.
If the security manager is enabled, requires getStackInspector
WildFlySecurityManagerPermission
.StackInspector
instancepublic Class<?> getCallerClass(int skipFrames)
skipFrames
argument specifies how many spots to go back
on the call stack; 0 indicates the immediate caller.skipFrames
- the number of frames to skip over before the immediate callerpublic Class<?>[] getCallStack(int skipFrames, int numFrames)
numFrames
argument specifies how many frames should be
returned.skipFrames
- the number of frames to skip; 0 will include the immediate caller at index 0numFrames
- the maximum number of frames to returnpublic Class<?>[] getCallStack(int skipFrames)
numFrames
argument specifies how many frames should be
returned.skipFrames
- the number of frames to skip; 0 will include the immediate caller at index 0public Class<?>[] getCallStack()
public boolean callStackContains(Class<?> clazz)
clazz
- the class to testtrue
if the call stack contains the classCopyright © 2020 JBoss by Red Hat. All rights reserved.