Save This Page
Home » openjdk-7 » java » lang » [javadoc | source]
java.lang
final class: VMSecurityManager [javadoc | source]
java.lang.Object
   java.lang.VMSecurityManager
VMSecurityManager is a helper class for SecurityManager the VM must implement.
Method from java.lang.VMSecurityManager Summary:
currentClassLoader,   getClassContext
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.lang.VMSecurityManager Detail:
 static native ClassLoader currentClassLoader()
    Get the current ClassLoader. This is the first non-null class loader on the stack, if one exists, stopping either at the end of the stack or the first instance of a PrivilegedAction. In other words, this call automatically unwinds past all classes loaded by the bootstrap loader, where getClassLoader() returns null, to get to the user class that really invoked the call that needs a classloader.
 static native Class[] getClassContext()
    Get a list of all the classes currently executing methods on the Java stack. getClassContext()[0] is the currently executing method, ie. the method which called SecurityManager.getClassContext(). (Hint: you may need to pop off one or more frames: don't include SecurityManager or VMSecurityManager.getClassContext in your result. Also, be sure that you correctly handle the context if SecurityManager.getClassContext was invoked by reflection).