home *** CD-ROM | disk | FTP | other *** search
- package java.lang;
-
- import java.io.FileDescriptor;
- import java.net.URL;
-
- public abstract class SecurityManager {
- protected boolean inCheck;
- private boolean initialized = false;
- private static SecurityManager security;
-
- public synchronized boolean getInCheck() {
- return this.inCheck;
- }
-
- protected SecurityManager() {
- if (System.getSecurityManager() != null) {
- throw new SecurityException("can't create SecurityManager");
- } else {
- this.initialized = true;
- }
- }
-
- protected native Class[] getClassContext();
-
- protected native ClassLoader currentClassLoader();
-
- protected native int classDepth(String var1);
-
- protected native int classLoaderDepth();
-
- protected native boolean checkClassLoader(int var1);
-
- protected boolean inClass(String name) {
- this.checkInitialized();
- return this.classDepth(name) >= 0;
- }
-
- protected boolean inClassLoader() {
- this.checkInitialized();
- return this.currentClassLoader() != null;
- }
-
- public Object getSecurityContext() {
- return null;
- }
-
- public void checkCreateClassLoader(int caller_depth) {
- throw new SecurityException();
- }
-
- public void checkCreateClassLoader() {
- this.checkCreateClassLoader(2);
- }
-
- public void checkAccess(Thread g, int caller_depth) {
- throw new SecurityException();
- }
-
- public void checkAccess(Thread g, Throwable o, int caller_depth) {
- throw new SecurityException();
- }
-
- public void checkAccess(Thread g) {
- this.checkAccess((Thread)g, 2);
- }
-
- public void checkAccess(ThreadGroup g, int caller_depth) {
- throw new SecurityException();
- }
-
- public void checkAccess(ThreadGroup g) {
- this.checkAccess((ThreadGroup)g, 4);
- }
-
- public void checkExit(int status) {
- throw new SecurityException();
- }
-
- public void checkExec(String cmd) {
- throw new SecurityException();
- }
-
- public void checkLink(String lib, int caller_depth) {
- throw new SecurityException();
- }
-
- public void checkLink(String lib) {
- this.checkLink(lib, 2);
- this.checkLink(lib, 3);
- }
-
- public void checkRead(FileDescriptor fd) {
- throw new SecurityException();
- }
-
- public void checkRead(String file) {
- throw new SecurityException();
- }
-
- public void checkRead(String file, Object context) {
- throw new SecurityException();
- }
-
- public void checkWrite(FileDescriptor fd) {
- throw new SecurityException();
- }
-
- public void checkWrite(String file) {
- throw new SecurityException();
- }
-
- public void checkDelete(String file) {
- throw new SecurityException();
- }
-
- public void checkConnect(String host, int port) {
- throw new SecurityException();
- }
-
- public void checkConnect(String host, int port, Object context) {
- throw new SecurityException();
- }
-
- public void checkURLConnect(URL url) {
- throw new SecurityException();
- }
-
- public void checkListen(int port) {
- throw new SecurityException();
- }
-
- public void checkAccept(String host, int port) {
- throw new SecurityException();
- }
-
- public void checkPropertiesAccess(int caller_depth) {
- throw new SecurityException();
- }
-
- public void checkPropertiesAccess() {
- this.checkPropertiesAccess(2);
- }
-
- public void checkPropertyAccess(String key, int caller_depth) {
- throw new SecurityException();
- }
-
- public void checkPropertyAccess(String key) {
- this.checkPropertyAccess(key, 2);
- }
-
- public void checkPropertyAccess(String key, String def) {
- throw new SecurityException();
- }
-
- public boolean checkTopLevelWindow(Object window) {
- return false;
- }
-
- public void checkPackageAccess(String pkg) {
- throw new SecurityException();
- }
-
- public void checkPackageDefinition(String pkg) {
- throw new SecurityException();
- }
-
- public void checkSetFactory() {
- throw new SecurityException();
- }
-
- private native boolean checkInitialized();
-
- public static void setSecurityManager() {
- if (security != null) {
- throw new SecurityException("SecurityManager already set");
- } else {
- security = System.getSecurityManager();
- }
- }
-
- public static void checksCreateClassLoader(int caller_depth) {
- if (security != null) {
- security.checkCreateClassLoader(caller_depth + 1);
- }
-
- }
-
- public static void checksExit(int status) {
- if (security != null) {
- security.checkExit(status);
- }
-
- }
-
- public static void checksExec(String cmd) {
- if (security != null) {
- security.checkExec(cmd);
- }
-
- }
-
- public static void checksLink(String lib, int caller_depth) {
- if (security != null) {
- security.checkLink(lib, caller_depth + 1);
- }
-
- }
-
- public static void checksPropertiesAccess(int caller_depth) {
- if (security != null) {
- security.checkPropertiesAccess(caller_depth + 1);
- }
-
- }
-
- public static void checksPropertyAccess(String key, int caller_depth) {
- if (security != null) {
- security.checkPropertyAccess(key, caller_depth + 1);
- }
-
- }
-
- public static void checksAccess(Thread t, int caller_depth) {
- if (security != null) {
- security.checkAccess(t, caller_depth + 1);
- }
-
- }
-
- public static void checksAccess(Thread t, Throwable o, int caller_depth) {
- if (security != null) {
- security.checkAccess(t, o, caller_depth + 1);
- }
-
- }
-
- public static void checksAccess(ThreadGroup g, int caller_depth) {
- if (security != null) {
- security.checkAccess(g, caller_depth + 1);
- }
-
- }
-
- public static void checksURLConnect(URL url) {
- if (security != null) {
- security.checkURLConnect(url);
- }
-
- }
-
- public native boolean checkScopePermission(int var1);
-
- public static native void setScopePermission();
-
- public static native void setAppletScopePermission();
-
- public static native void resetScopePermission();
- }
-