org.apache.jorphan.util

Class ClassContext


public final class ClassContext
extends SecurityManager

Class to get access to the protected getClassContext() method of SecurityManager, thus obtaining the call stack. May not work with applications that install their own security managers.

Method Summary

static String
getCallerClassNameAt(int i)
Get the name of the class at a particular stack depth i=0 gives this class
static Class[]
getMyClassContext()
Gets the calling context as an array of classes Class[0] is this class.

Method Details

getCallerClassNameAt

public static String getCallerClassNameAt(int i)
Get the name of the class at a particular stack depth i=0 gives this class
Parameters:
i - - stack depth
Returns:
String - name of class at depth i

getMyClassContext

public static Class[] getMyClassContext()
Gets the calling context as an array of classes Class[0] is this class.
Returns:
Class[] - list of classes in the callers context

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.