Class java.lang.SecurityManager
All Packages    This Package    Previous    Next

Class java.lang.SecurityManager

java.lang.Object
   |
   +----java.lang.SecurityManager

public class SecurityManager
extends Object
Security Manager. An abstract class that can be subclassed to implement a security policy. It allows the inspection of the classloaders on the execution stack.
Author:
Arthur van Hoff
Version:
1.19, 10/24/95

Constructor Index

 o SecurityManager()
Constructs a new SecurityManager.

Method Index

 o checkAccept(String, int)
Checks to see if a socket connection to the specified port on the specified host has been accepted.
 o checkAccess(Thread)
Checks to see if the specified Thread is allowed to modify the Thread group.
 o checkAccess(ThreadGroup)
Checks to see if the specified Thread group is allowed to modify this group.
 o checkConnect(String, int)
Checks to see if a socket has connected to the specified port on the the specified host.
 o checkCreateClassLoader()
Checks to see if the ClassLoader has been created.
 o checkExec(String)
Checks to see if the system command is executed by trusted code.
 o checkExit(int)
Checks to see if the system has exited the virtual machine with an exit code.
 o checkLink(String)
Checks to see if the specified linked library exists.
 o checkListen(int)
Checks to see if a server socket is listening to the specified local port that it is bounded to.
 o checkPackageAccess(String)
Check if an applet can access a package.
 o checkPackageDefinition(String)
Check if an applet can define classes in a package.
 o checkPropertiesAccess()
Checks to see who has access to the System properties.
 o checkRead(int)
Checks to see if an input file with the specified system dependent file descriptor gets created.
 o checkRead(String)
Checks to see if an input file with the specified system dependent file name gets created.
 o checkSetFactory()
Check if an applet can set a networking-related object factory.
 o checkTopLevelWindow()
Checks to see if top-level windows can be created by the caller.
 o checkWrite(int)
Checks to see if an output file with the specified system dependent file descriptor gets created.
 o checkWrite(String)
Checks to see if an output file with the specified system dependent file name gets created.
 o classDepth(String)
Return the position of the stack frame containing the first occurrence of the named class.
 o classLoaderDepth()
 o currentClassLoader()
The current ClassLoader on the execution stack.
 o getClassContext()
Gets the context of this Class.
 o inClass(String)
Returns true if the specified String is in this Class.
 o inClassLoader()
Returns a boolean indicating whether or not the current ClassLoader is equal to null.

Constructors

 o SecurityManager
  protected SecurityManager()
Constructs a new SecurityManager.
Throws: SecurityException
If the security manager cannot be created.

Methods

 o getClassContext
  protected Class[] getClassContext()
Gets the context of this Class.

 o currentClassLoader

  protected ClassLoader currentClassLoader()
The current ClassLoader on the execution stack.

 o classDepth

  protected int classDepth(String name)
Return the position of the stack frame containing the first occurrence of the named class.
Parameters:
name - classname of the class to search for

 o classLoaderDepth

  protected int classLoaderDepth()

 o inClass

  protected boolean inClass(String name)
Returns true if the specified String is in this Class.
Parameters:
name - the name of the class

 o inClassLoader

  protected boolean inClassLoader()
Returns a boolean indicating whether or not the current ClassLoader is equal to null.

 o checkCreateClassLoader

  public void checkCreateClassLoader()
Checks to see if the ClassLoader has been created.
Throws: SecurityException
If a security error has occurred.

 o checkAccess

  public void checkAccess(Thread g)
Checks to see if the specified Thread is allowed to modify the Thread group.
Parameters:
g - the Thread to be checked
Throws: SecurityException
If the current Thread is not allowed to access this Thread group.

 o checkAccess

  public void checkAccess(ThreadGroup g)
Checks to see if the specified Thread group is allowed to modify this group.
Parameters:
g - the Thread group to be checked
Throws: SecurityException
If the current Thread group is not allowed to access this Thread group.

 o checkExit

  public void checkExit(int status)
Checks to see if the system has exited the virtual machine with an exit code.
Parameters:
status - exit status, 0 if successful, other values indicate various error types.
Throws: SecurityException
If a security error has occurred.

 o checkExec

  public void checkExec(String cmd)
Checks to see if the system command is executed by trusted code.
Parameters:
cmd - the specified system command
Throws: SecurityException
If a security error has occurred.

 o checkLink

  public void checkLink(String lib)
Checks to see if the specified linked library exists.
Parameters:
lib - the name of the library
Throws: SecurityException
If the library does not exist.

 o checkRead

  public void checkRead(int fd)
Checks to see if an input file with the specified system dependent file descriptor gets created.
Parameters:
fd - the system dependent file descriptor
Throws: SecurityException
If a security error has occurred.

 o checkRead

  public void checkRead(String file)
Checks to see if an input file with the specified system dependent file name gets created.
Parameters:
file - the system dependent file name
Throws: SecurityException
If the file is not found.

 o checkWrite

  public void checkWrite(int fd)
Checks to see if an output file with the specified system dependent file descriptor gets created.
Parameters:
fd - the system dependent file descriptor
Throws: SecurityException
If a security error has occurred.

 o checkWrite

  public void checkWrite(String file)
Checks to see if an output file with the specified system dependent file name gets created.
Parameters:
file - the system depepndent file name
Throws: SecurityException
If the file is not found.

 o checkConnect

  public void checkConnect(String host,
                           int port)
Checks to see if a socket has connected to the specified port on the the specified host.
Parameters:
host - the host name port to connect to
port - the protocol port to connect to
Throws: SecurityException
If a security error has occurred.

 o checkListen

  public void checkListen(int port)
Checks to see if a server socket is listening to the specified local port that it is bounded to.
Parameters:
port - the protocol port to connect to
Throws: SecurityException
If a security error has occurred.

 o checkAccept

  public void checkAccept(String host,
                          int port)
Checks to see if a socket connection to the specified port on the specified host has been accepted.
Parameters:
host - the host name to connect to
port - the protocol port to connect to
Throws: SecurityException
If a security error has occurred.

 o checkPropertiesAccess

  public void checkPropertiesAccess()
Checks to see who has access to the System properties.
Throws: SecurityException
If a security error has occurred.

 o checkTopLevelWindow

  public boolean checkTopLevelWindow()
Checks to see if top-level windows can be created by the caller. A return of false means that the window creation is allowed but the window should indicate some sort of visual warning. Returning true means the creation is allowed with no special restrictions. To disallow the creation entirely, this method should throw a SecurityException.

 o checkPackageAccess

  public void checkPackageAccess(String pkg)
Check if an applet can access a package.

 o checkPackageDefinition

  public void checkPackageDefinition(String pkg)
Check if an applet can define classes in a package.

 o checkSetFactory

  public void checkSetFactory()
Check if an applet can set a networking-related object factory.


All Packages    This Package    Previous    Next