1 |
/* VMSecurityManager.java |
/* VMSecurityManager.java -- Reference implementation of VM hooks for security |
2 |
Copyright (C) 1998 Free Software Foundation |
Copyright (C) 1998, 2002 Free Software Foundation |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
37 |
|
|
38 |
package java.lang; |
package java.lang; |
39 |
|
|
|
import java.net.*; |
|
|
import java.util.*; |
|
|
import java.io.*; |
|
|
|
|
40 |
/** |
/** |
41 |
** VMSecurityManager is a helper class for SecurityManager the VM must |
* VMSecurityManager is a helper class for SecurityManager the VM must |
42 |
** implement. |
* implement. |
43 |
** |
* |
44 |
** @author John Keiser |
* @author John Keiser |
45 |
** @version 1.1.0, 31 May 1998 |
* @author Eric Blake <ebb9@email.byu.edu> |
46 |
**/ |
*/ |
47 |
class VMSecurityManager { |
final class VMSecurityManager |
48 |
/** Get a list of all the classes currently executing |
{ |
49 |
** methods on the Java stack. getClassContext()[0] is |
/** |
50 |
** the currently executing method |
* Get a list of all the classes currently executing methods on the |
51 |
** <STRONG>Spec Note:</STRONG> does not say whether |
* Java stack. getClassContext()[0] is the currently executing method, ie. |
52 |
** the stack will include the getClassContext() call or |
* the method which called SecurityManager.getClassContext(). (Hint: you |
53 |
** the one just before it. |
* may need to pop off one or more frames: don't include SecurityManager |
54 |
** |
* or VMSecurityManager.getClassContext in your result. Also, be sure that |
55 |
** @return an array containing all the methods on classes |
* you correctly handle the context if SecurityManager.getClassContext |
56 |
** on the Java execution stack. |
* was invoked by reflection). |
57 |
**/ |
* |
58 |
static native Class[] getClassContext(); |
* @return an array of the declaring classes of each stack frame |
59 |
|
*/ |
60 |
/** Get the current ClassLoader--the one nearest to the |
static native Class[] getClassContext(); |
61 |
** top of the stack. |
|
62 |
** @return the current ClassLoader. |
/** |
63 |
**/ |
* Get the current ClassLoader--the one nearest to the top of the stack. |
64 |
static native ClassLoader currentClassLoader(); |
* |
65 |
|
* @return the current ClassLoader |
66 |
|
*/ |
67 |
|
static native ClassLoader currentClassLoader(); |
68 |
} |
} |