|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.util.StackIntrospector
A set of utilities to inspect current stack frame.
Nested Class Summary | |
private static class |
StackIntrospector.CallStack
Hack to get the call stack as an array of classes. |
Field Summary | |
private static StackIntrospector.CallStack |
c_callStack
|
Constructor Summary | |
private |
StackIntrospector()
Private constructor to block instantiation. |
Method Summary | |
static java.lang.Class |
getCallerClass(java.lang.Class clazz)
Find the caller of the passed in Class. |
static java.lang.Class |
getCallerClass(java.lang.Class clazz,
int stackDepthOffset)
Find the caller of the passed in Class. |
static java.lang.String |
getCallerMethod(java.lang.Class clazz)
Get the method path name for the method from which the LogEvent was created, this includes the path name and the source filename and line number if the source was compiled with debugging on. |
private static StackIntrospector.CallStack |
getCallStack()
Create Hack SecurityManager to get CallStack. |
static java.lang.String |
getRecentStack(java.lang.Class clazz,
int entries)
Return the current call stack as a String, starting with the first call in the stack after a reference to the clazz class, and then
display entries entries. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static StackIntrospector.CallStack c_callStack
Constructor Detail |
private StackIntrospector()
Method Detail |
private static StackIntrospector.CallStack getCallStack() throws java.lang.SecurityException
java.lang.SecurityException
- if an existing SecurityManager disallows construction
of another SecurityManagerpublic static final java.lang.Class getCallerClass(java.lang.Class clazz) throws java.lang.SecurityException
clazz
- the Class to search for on stack to find caller of
java.lang.SecurityException
- if an existing SecurityManager disallows construction
of another SecurityManager and thus blocks method resultspublic static final java.lang.Class getCallerClass(java.lang.Class clazz, int stackDepthOffset)
clazz
- the Class to search for on stack to find caller ofstackDepthOffset
- Offset call-stack depth to find caller
java.lang.SecurityException
- if an existing SecurityManager disallows construction
of another SecurityManager and thus blocks method resultspublic static final java.lang.String getCallerMethod(java.lang.Class clazz)
clazz
- the Class to search for on stack to find caller of
public static final java.lang.String getRecentStack(java.lang.Class clazz, int entries)
clazz
class, and then
display entries
entries.
This can be useful for debugging code to determine where calls to a method are coming from.
clazz
- the last class on the stack you are not interested in!entries
- the number of stack lines to return.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |