java.lang.SecurityManager (JDK 1.0)
This abstract class defines the methods necessary to implement a security policy for the execution of untrusted code. Before performing potentially sensitive operations, Java calls methods of the SecurityManager object currently in effect to determine whether the operations are permitted. These methods throw a SecurityException if the operation is not permitted.
Normal applications do not need to use or subclass the SecurityManager class. It is typically only used by Web browsers, applet viewers, and other programs that need to run untrusted code in a controlled environment.
public abstract classSecurityManagerextends Object { //Protected ConstructorprotectedSecurityManager(); //Protected Instance Variablesprotected booleaninCheck; //Public Instance Methodspublic voidcheckAccept(Stringhost, intport); public voidcheckAccess(Threadg); public voidcheckAccess(ThreadGroupg); 1.1public voidcheckAwtEventQueueAccess(); public voidcheckConnect(Stringhost, intport); public voidcheckConnect(Stringhost, intport, Objectcontext); public voidcheckCreateClassLoader(); public voidcheckDelete(Stringfile); public voidcheckExec(Stringcmd); public voidcheckExit(intstatus); public voidcheckLink(Stringlib); public voidcheckListen(intport); 1.1public voidcheckMemberAccess(Classclazz, intwhich); 1.1public voidcheckMulticast(InetAddressmaddr); 1.1public voidcheckMulticast(InetAddressmaddr, bytettl); public voidcheckPackageAccess(Stringpkg); public voidcheckPackageDefinition(Stringpkg); 1.1public voidcheckPrintJobAccess(); public voidcheckPropertiesAccess(); public voidcheckPropertyAccess(Stringkey); public voidcheckRead(FileDescriptorfd); public voidcheckRead(Stringfile); public voidcheckRead(Stringfile, Objectcontext); 1.1public voidcheckSecurityAccess(Stringaction); public voidcheckSetFactory(); 1.1public voidcheckSystemClipboardAccess(); public booleancheckTopLevelWindow(Objectwindow); public voidcheckWrite(FileDescriptorfd); public voidcheckWrite(Stringfile); public booleangetInCheck(); public ObjectgetSecurityContext(); 1.1public ThreadGroupgetThreadGroup(); //Protected Instance Methodsprotected native intclassDepth(Stringname); protected native intclassLoaderDepth(); protected native ClassLoadercurrentClassLoader(); 1.1protected ClasscurrentLoadedClass(); protected native Class[]getClassContext(); protected booleaninClass(Stringname); protected booleaninClassLoader(); }
Passed To:
System.setSecurityManager()
Returned By:
System.getSecurityManager()