All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.lang.SecurityManager

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

public class SecurityManager
extends Object
The security manager is a class that allows applications to implement a security policy. It allows an application to determine, before performing a possibly unsafe or sensitive operation, what the operation is and whether the operation is being performed by a class created via a class loader rather than installed locally. Classes loaded via a class loader (especially if they have been downloaded over a network) may be less trustworthy than classes from files installed locally. The application can allow or disallow the operation.

The SecurityManager class contains many methods with names that begin with the word check. These methods are called by various methods in the Java libraries before those methods perform certain potentially sensitive operations. The invocation of such a check method typically looks like this:

     SecurityManager security = System.getSecurityManager();
     if (security != null) {
         security.checkXXX(argument,  . . . );
     }
 

The security manager is thereby given an opportunity to prevent completion of the operation by throwing an exception. A security manager routine simply returns if the operation is permitted, but throws a SecurityException if the operation is not permitted. The only exception to this convention is checkTopLevelWindow, which returns a boolean value.

The current security manager is set by the setSecurityManager method in class System. The current security manager is obtained by the getSecurityManager method.

As of JDK 1.2, the default implementation of each of the checkXXX methods is to use the AccessController to determine if the caller has permission to perform the requested operation.

Permissions fall into these categories: File, Socket, Net, Security, Runtime, Property, and AWT. The classes managing these various permission categories are java.io.FilePermission, java.net.SocketPermission, java.net.NetPermission, java.security.SecurityPermission, java.lang.RuntimePermission, java.util.PropertyPermission, and java.awt.AWTPermission.

All but the first two (FilePermission and SocketPermission) are subclasses of java.security.BasicPermission, which itself is an abstract subclass of the top-level class for permissions, which is java.security.Permission. BasicPermission defines the functionality needed for all permissions that contain a name that follows the hierarchical property naming convention (for example, "exit", "setFactory", "print.queueJob", etc). An asterisk may appear at the end of the name, following a ".", or by itself, to signify a wildcard match. For example: "a.*" or "*" is valid, "*a" or "a*b" is not valid.

FilePermission and SocketPermission are subclasses of the top-level class for permissions (java.security.Permission). Classes like these that have a more complicated name syntax than that used by BasicPermission subclass directly from Permission rather than from BasicPermission. For example, for a java.io.FilePermission object, the permission name is the pathname of a file (or directory).

Some of the permission classes have an "actions" list that tells the actions that are permitted for the object. For example, for a java.io.FilePermission object, the actions list (such as "read, write") specifies which actions are granted for the specified file (or for files in the specified directory).

Other permission classes are for "named" permissions - ones that contain a name but no actions list; you either have the named permission or you don't.

The permission namespace is organized in the manner shown below. For each category, the category name is given, followed by an indented list of permission names (such as "createClassLoader" and "exit") and permission name types in braces (such as "{property name}" to represent an actual property name). Each permission name (or name type) is followed by the name in parentheses of the SecurityManager class(es) that handle that kind of permission.

 RuntimePermission
    createClassLoader  (checkCreateClassLoader)
    exit (checkExit)
    setFactory (checkSetFactory)
    setIO (java.lang.System.{setIn,setOut,SetErr})
    thread (checkAccess(Thread), checkAccess(ThreadGroup))
    fileDescriptor.read (checkRead(FileDescriptor))
    fileDescriptor.write (checkWrite(FileDescriptor))
    loadLibrary.{library name} (checkLink)
    package.access.{package name}  (checkPackageAccess)
    package.define.{package name} (checkPackageDefinition)
    reflect.declared.{class name} (checkMemberAccess)
    print.queueJob (checkPrintJobAccess)
 NetPermission
    multicast (checkMulticast)
    Authenticator.setDefault
    Authenticator.requestPasswordAuthentication
 PropertyPermission
    * (checkPropertiesAccess)
    {property name} (checkPropertyAccess)
 AWTPermission
    topLevelWindow (checkTopLevelWindow)
    systemClipboard (checkSystemClipboardAccess)
    eventQueue (checkAwtEventQueueAccess)
 SecurityPermission
    {action} (checkSecurityAccess)
 FilePermission
    {file or directory pathname} (checkExec, 
        checkRead(String), checkWrite(String), checkDelete}
 SocketPermission
    {host:port} {checkConnect, checkListen, checkAccept}
 

Since:
JDK1.0
See Also:
ClassLoader, SecurityException, checkTopLevelWindow, getSecurityManager, setSecurityManager, AccessController, AccessControlException, Permission, BasicPermission, FilePermission, SocketPermission, PropertyPermission, RuntimePermission, AWTPermission, Policy, SecurityPermission, java.security.ProtectionDomain

Variable Index

 o inCheck
This field is true if there is a security check in progress; false otherwise. Deprecated.

Constructor Index

 o SecurityManager()
Constructs a new SecurityManager.

Method Index

 o checkAccept(String, int)
Throws an AccessControlException if the calling thread is not permitted to accept a socket connection from the specified host and port number.
 o checkAccess(Thread)
Throws an AccessControlException if the calling thread is not allowed to modify the thread argument.
 o checkAccess(ThreadGroup)
Throws an AccessControlException if the calling thread is not allowed to modify the thread group argument.
 o checkAwtEventQueueAccess()
Tests if a client can get access to the AWT event queue.
 o checkConnect(String, int)
Throws an AccessControlException if the calling thread is not allowed to open a socket connection to the specified host and port number.
 o checkConnect(String, int, Object)
Throws a SecurityException if the specified security context is not allowed to open a socket connection to the specified host and port number.
 o checkCreateClassLoader()
Throws an AccessControlException if the calling thread is not allowed to create a new class loader.
 o checkDelete(String)
Throws an AccessControlException if the calling thread is not allowed to delete the specified file.
 o checkExec(String)
Throws an AccessControlException if the calling thread is not allowed to create a subprocess.
 o checkExit(int)
Throws an AccessControlException if the calling thread is not allowed to cause the Java Virtual Machine to halt with the specified status code.
 o checkLink(String)
Throws an AccessControlException if the calling thread is not allowed to dynamic link the library code specified by the string argument file.
 o checkListen(int)
Throws an AccessControlException if the calling thread is not allowed to wait for a connection request on the specified local port number.
 o checkMemberAccess(Class, int)
Tests if a client is allowed to access members.
 o checkMulticast(InetAddress)
Tests if current execution context is allowed to use (join/leave/send/receive) IP multicast.
 o checkMulticast(InetAddress, byte)
Tests to see if current execution context is allowed to use (join/leave/send/receive) IP multicast.
 o checkPackageAccess(String)
Throws an AccessControlException if the calling thread is not allowed to access the package specified by the argument.
 o checkPackageDefinition(String)
Throws an AccessControlException if the calling thread is not allowed to define classes in the package specified by the argument.
 o checkPrintJobAccess()
Tests if a client can initiate a print job request.
 o checkPropertiesAccess()
Throws an AccessControlException if the calling thread is not allowed to access or modify the system properties.
 o checkPropertyAccess(String)
Throws an AccessControlException if the calling thread is not allowed to access the system property with the specified key name.
 o checkRead(FileDescriptor)
Throws an AccessControlException if the calling thread is not allowed to read from the specified file descriptor.
 o checkRead(String)
Throws an AccessControlException if the calling thread is not allowed to read the file specified by the string argument.
 o checkRead(String, Object)
Throws a SecurityException if the specified security context is not allowed to read the file specified by the string argument.
 o checkSecurityAccess(String)
Tests access to certain operations for a security API action.
 o checkSetFactory()
Throws an AccessControlException if the calling thread is not allowed to set the socket factory used by ServerSocket or Socket, or the stream handler factory used by URL.
 o checkSystemClipboardAccess()
Tests if a client can get access to the system clipboard.
 o checkTopLevelWindow(Object)
Returns false if the calling thread is not trusted to bring up the top-level window indicated by the window argument.
 o checkWrite(FileDescriptor)
Throws an AccessControlException if the calling thread is not allowed to write to the specified file descriptor.
 o checkWrite(String)
Throws an AccessControlException if the calling thread is not allowed to write to the file specified by the string argument.
 o classDepth(String)
Returns the stack depth of the specified class. Deprecated.
 o classLoaderDepth()
Returns the stack depth of the most recently executing method from a class defined using a class loader. Deprecated.
 o currentClassLoader()
Returns an object describing the most recent class loader executing on the stack.
 o currentLoadedClass()
Returns the current Class with a ClassLoader on the execution stack.
 o getClassContext()
Returns the current execution stack as an array of classes.
 o getInCheck()
Tests if there is a security check in progress. Deprecated.
 o getSecurityContext()
Creates an object that encapsulates the current execution environment.
 o getThreadGroup()
Returns the thread group into which to instantiate any new thread being created at the time this is being called.
 o inClass(String)
Tests if a method from a class with the specified name is on the execution stack. Deprecated.
 o inClassLoader()
Tests if a method from a class defined using a class loader is on the execution stack. Deprecated.

Variables

 o inCheck
protected boolean inCheck
Note: inCheck is deprecated. This type of security checking is not recommended. It is recommended that the AccessController.checkPermission call be used instead.

This field is true if there is a security check in progress; false otherwise.

Constructors

 o SecurityManager
public SecurityManager()
Constructs a new SecurityManager. An application is not allowed to create a new security manager if there is already a current security manager.

Throws: SecurityException
if a security manager already exists.
See Also:
getSecurityManager

Methods

 o getInCheck
public boolean getInCheck()
Note: getInCheck() is deprecated. This type of security checking is not recommended. It is recommended that the AccessController.checkPermission call be used instead.

Tests if there is a security check in progress.

Returns:
the value of the inCheck field. This field should contain true if a security check is in progress, false otherwise.
See Also:
inCheck
 o getClassContext
protected Class[] getClassContext()
Returns the current execution stack as an array of classes.

The length of the array is the number of methods on the execution stack. The element at index 0 is the class of the currently executing method, the element at index 1 is the class of that method's caller, and so on.

Returns:
the execution stack.
 o currentClassLoader
protected ClassLoader currentClassLoader()
Returns an object describing the most recent class loader executing on the stack.

Returns:
the class loader of the most recent occurrence on the stack of a method from a class defined using a class loader; returns null if there is no occurrence on the stack of a method from a class defined using a class loader.
 o currentLoadedClass
protected Class currentLoadedClass()
Returns the current Class with a ClassLoader on the execution stack.

 o classDepth
protected int classDepth(String name)
Note: classDepth() is deprecated. This type of security checking is not recommended. It is recommended that the AccessController.checkPermission call be used instead.

Returns the stack depth of the specified class.

Parameters:
name - the fully qualified name of the class to search for.
Returns:
the depth on the stack frame of the first occurrence of a method from a class with the specified name; -1 if such a frame cannot be found.
 o classLoaderDepth
protected int classLoaderDepth()
Note: classLoaderDepth() is deprecated. This type of security checking is not recommended. It is recommended that the AccessController.checkPermission call be used instead.

Returns the stack depth of the most recently executing method from a class defined using a class loader.

Returns:
the depth on the stack frame of the most recent occurrence of a method from a class defined using a class loader; returns -1 if there is no occurrence of a method from a class defined using a class loader.
 o inClass
protected boolean inClass(String name)
Note: inClass() is deprecated. This type of security checking is not recommended. It is recommended that the AccessController.checkPermission call be used instead.

Tests if a method from a class with the specified name is on the execution stack.

Parameters:
name - the fully qualified name of the class.
Returns:
true if a method from a class with the specified name is on the execution stack; false otherwise.
 o inClassLoader
protected boolean inClassLoader()
Note: inClassLoader() is deprecated. This type of security checking is not recommended. It is recommended that the AccessController.checkPermission call be used instead.

Tests if a method from a class defined using a class loader is on the execution stack.

Returns:
true if a method from a class defined using a class loader is on the execution stack.
 o getSecurityContext
public Object getSecurityContext()
Creates an object that encapsulates the current execution environment. The result of this method is used by the three-argument checkConnect method and by the two-argument checkRead method.

These methods are needed because a trusted method may be called on to read a file or open a socket on behalf of another method. The trusted method needs to determine if the other (possibly untrusted) method would be allowed to perform the operation on its own.

Returns:
an implementation-dependent object that encapsulates sufficient information about the current execution environment to perform some security checks later.
See Also:
checkConnect, checkRead
 o checkCreateClassLoader
public void checkCreateClassLoader()
Throws an AccessControlException if the calling thread is not allowed to create a new class loader.

The checkCreateClassLoader method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("createClassLoader") permission.

Throws: AccessControlException
if the caller does not have permission to create a new class loader.
See Also:
ClassLoader
 o checkAccess
public void checkAccess(Thread g)
Throws an AccessControlException if the calling thread is not allowed to modify the thread argument.

This method is invoked for the current security manager by the stop, suspend, resume, setPriority, setName, and setDaemon methods of class Thread.

The checkAccess method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("thread") permission.

Parameters:
g - the thread to be checked.
Throws: AccessControlException
if the caller does not have permission to modify the thread.
See Also:
getSecurityManager, resume, setDaemon, setName, setPriority, stop, suspend
 o checkAccess
public void checkAccess(ThreadGroup g)
Throws an AccessControlException if the calling thread is not allowed to modify the thread group argument.

This method is invoked for the current security manager when a new child thread or child thread group is created, and by the setDaemon, setMaxPriority, stop, suspend, resume, and destroy methods of class ThreadGroup.

The checkAccess method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("thread") permission.

Parameters:
g - the thread group to be checked.
Throws: AccessControlException
if the caller does not have permission to modify the thread group.
See Also:
getSecurityManager, destroy, resume, setDaemon, setMaxPriority, stop, suspend
 o checkExit
public void checkExit(int status)
Throws an AccessControlException if the calling thread is not allowed to cause the Java Virtual Machine to halt with the specified status code.

This method is invoked for the current security manager by the exit method of class Runtime. A status of 0 indicates success; other values indicate various errors.

The checkExit method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("exit") permission.

Parameters:
status - the exit status.
Throws: AccessControlException
if the caller does not have permission to halt the Java Virtual Machine with the specified status.
See Also:
exit, getSecurityManager
 o checkExec
public void checkExec(String cmd)
Throws an AccessControlException if the calling thread is not allowed to create a subprocess.

This method is invoked for the current security manager by the exec methods of class Runtime.

The checkExec method for class SecurityManager calls AccessController.checkPermission with the FilePermission(cmd,"execute") permission.

Parameters:
cmd - the specified system command.
Throws: AccessControlException
if the caller does not have permission to create a subprocess.
See Also:
exec, exec, exec, exec, getSecurityManager
 o checkLink
public void checkLink(String lib)
Throws an AccessControlException if the calling thread is not allowed to dynamic link the library code specified by the string argument file. The argument is either a simple library name or a complete filename.

This method is invoked for the current security manager by methods load and loadLibrary of class Runtime.

The checkLink method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("loadLibrary."+lib) permission.

Parameters:
lib - the name of the library.
Throws: AccessControlException
if the caller does not have permission to dynamically link the library.
See Also:
load, loadLibrary, getSecurityManager
 o checkRead
public void checkRead(FileDescriptor fd)
Throws an AccessControlException if the calling thread is not allowed to read from the specified file descriptor.

The checkRead method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("fileDescriptor.read") permission.

Parameters:
fd - the system-dependent file descriptor.
Throws: AccessControlException
if the caller does not have permission to access the specified file descriptor.
See Also:
FileDescriptor
 o checkRead
public void checkRead(String file)
Throws an AccessControlException if the calling thread is not allowed to read the file specified by the string argument.

The checkRead method for class SecurityManager calls AccessController.checkPermission with the FilePermission(file,"read") permission.

Parameters:
file - the system-dependent file name.
Throws: AccessControlException
if the caller does not have permission to access the specified file.
 o checkRead
public void checkRead(String file,
                      Object context)
Throws a SecurityException if the specified security context is not allowed to read the file specified by the string argument. The context must be a security context returned by a previous call to getSecurityContext.

The checkRead method for class SecurityManager currently always throws a SecurityException.

Parameters:
file - the system-dependent filename.
context - a system-dependent security context.
Throws: SecurityException
if the specified security context does not have permission to read the specified file.
See Also:
getSecurityContext
 o checkWrite
public void checkWrite(FileDescriptor fd)
Throws an AccessControlException if the calling thread is not allowed to write to the specified file descriptor.

The checkWrite method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("fileDescriptor.write") permission.

Parameters:
fd - the system-dependent file descriptor.
Throws: AccessControlException
if the caller does not have permission to access the specified file descriptor.
See Also:
FileDescriptor
 o checkWrite
public void checkWrite(String file)
Throws an AccessControlException if the calling thread is not allowed to write to the file specified by the string argument.

The checkWrite method for class SecurityManager calls AccessController.checkPermission with the FilePermission(file,"write") permission.

Parameters:
file - the system-dependent filename.
Throws: AccessControlException
if the caller does not have permission to access the specified file.
 o checkDelete
public void checkDelete(String file)
Throws an AccessControlException if the calling thread is not allowed to delete the specified file.

This method is invoked for the current security manager by the delete method of class File.

The checkDelete method for class SecurityManager calls AccessController.checkPermission with the FilePermission(file,"delete") permission.

Parameters:
file - the system-dependent filename.
Throws: AccessControlException
if the caller does not have permission to delete the file.
See Also:
delete, getSecurityManager
 o checkConnect
public void checkConnect(String host,
                         int port)
Throws an AccessControlException if the calling thread is not allowed to open a socket connection to the specified host and port number.

A port number of -1 indicates that the calling method is attempting to determine the IP address of the specified host name.

The checkConnect method for class SecurityManager calls AccessController.checkPermission with the SocketPermission(host+":"+port,"connect") permission if the port is not equal to -1. If the port is equal to -1, then it calls AccessController.checkPermission with the SocketPermission(host,"resolve") permission.

Parameters:
host - the host name port to connect to.
port - the protocol port to connect to.
Throws: AccessControlException
if the caller does not have permission to open a socket connection to the specified host and port.
 o checkConnect
public void checkConnect(String host,
                         int port,
                         Object context)
Throws a SecurityException if the specified security context is not allowed to open a socket connection to the specified host and port number.

A port number of -1 indicates that the calling method is attempting to determine the IP address of the specified host name.

The checkConnect method for class SecurityManager currently always throws a SecurityException.

Parameters:
host - the host name port to connect to.
port - the protocol port to connect to.
context - a system-dependent security context.
Throws: SecurityException
if the specified security context does not have permission to open a socket connection to the specified host and port.
See Also:
getSecurityContext
 o checkListen
public void checkListen(int port)
Throws an AccessControlException if the calling thread is not allowed to wait for a connection request on the specified local port number.

If port is not 0, the checkListen method for class SecurityManager calls AccessController.checkPermission with the SocketPermission("localhost:"+port,"listen"). If port is zero, calls AccessController.checkPermission with SocketPermission("localhost:1024-","listen").

Parameters:
port - the local port.
Throws: AccessControlException
if the caller does not have permission to listen on the specified port.
 o checkAccept
public void checkAccept(String host,
                        int port)
Throws an AccessControlException if the calling thread is not permitted to accept a socket connection from the specified host and port number.

This method is invoked for the current security manager by the accept method of class ServerSocket.

The checkAccept method for class SecurityManager calls AccessController.checkPermission with the SocketPermission(host+":"+port,"accept") permission.

Parameters:
host - the host name of the socket connection.
port - the port number of the socket connection.
Throws: AccessControlException
if the caller does not have permission to accept the connection.
See Also:
getSecurityManager, accept
 o checkMulticast
public void checkMulticast(InetAddress maddr)
Tests if current execution context is allowed to use (join/leave/send/receive) IP multicast.

The checkMulticast method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("multicast") permission.

Parameters:
maddr - Internet group address to be used.
Throws: AccessControlException
if a security error has occurred.
 o checkMulticast
public void checkMulticast(InetAddress maddr,
                           byte ttl)
Tests to see if current execution context is allowed to use (join/leave/send/receive) IP multicast.

The checkMulticast method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("multicast") permission.

Parameters:
maddr - Internet group address to be used.
ttl - value in use, if it is multicast send.
Throws: AccessControlException
if a security error has occurred.
 o checkPropertiesAccess
public void checkPropertiesAccess()
Throws an AccessControlException if the calling thread is not allowed to access or modify the system properties.

This method is used by the getProperties and setProperties methods of class System.

The checkPropertiesAccess method for class SecurityManager calls AccessController.checkPermission with the PropertyPermission("*", "read,write") permission.

Throws: AccessControlException
if the caller does not have permission to access or modify the system properties.
See Also:
getProperties, setProperties
 o checkPropertyAccess
public void checkPropertyAccess(String key)
Throws an AccessControlException if the calling thread is not allowed to access the system property with the specified key name.

This method is used by the getProperty method of class System.

The checkPropertyAccess method for class SecurityManager calls AccessController.checkPermission with the PropertyPermission(key, "read") permission.

Parameters:
key - a system property key.
Throws: AccessControlException
if the caller does not have permission to access the specified system property.
See Also:
getProperty
 o checkTopLevelWindow
public boolean checkTopLevelWindow(Object window)
Returns false if the calling thread is not trusted to bring up the top-level window indicated by the window argument. In this case, the caller can still decide to show the window, but the window should include some sort of visual warning. If the method returns true, then the window can be shown without any special restrictions.

See class Window for more information on trusted and untrusted windows.

This method calls AccessController.checkPermission with the AWTPermission("topLevelWindow") permission, and returns true if an AccessControlException is not thrown, otherwise it returns false.

Parameters:
window - the new window that is being created.
Returns:
true if the caller is trusted to put up top-level windows; false otherwise.
Throws: AccessControlException
if creation is disallowed entirely.
See Also:
Window
 o checkPrintJobAccess
public void checkPrintJobAccess()
Tests if a client can initiate a print job request. This method calls AccessController.checkPermission with the RuntimePermission("print.queueJob") permission.

Throws: AccessControlException
if the caller does not have permission to initiate a print job request.
 o checkSystemClipboardAccess
public void checkSystemClipboardAccess()
Tests if a client can get access to the system clipboard.

This method calls AccessController.checkPermission with the AWTPermission("systemClipboard") permission.

Throws: AccessControlException
if the caller does not have permission to accesss the system clipboard.
 o checkAwtEventQueueAccess
public void checkAwtEventQueueAccess()
Tests if a client can get access to the AWT event queue.

This method calls AccessController.checkPermission with the AWTPermission("eventQueue") permission.

Throws: AccessControlException
if the caller does not have permission to accesss the AWT event queue.
 o checkPackageAccess
public void checkPackageAccess(String pkg)
Throws an AccessControlException if the calling thread is not allowed to access the package specified by the argument.

This method is used by the loadClass method of class loaders.

The checkPackageAccess method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("package.access."+pkg) permission.

Parameters:
pkg - the package name.
Throws: AccessControlException
if the caller does not have permission to access the specified package.
See Also:
loadClass
 o checkPackageDefinition
public void checkPackageDefinition(String pkg)
Throws an AccessControlException if the calling thread is not allowed to define classes in the package specified by the argument.

This method is used by the loadClass method of some class loaders.

The checkPackageDefinition method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("package.define."+pkg) permission.

Parameters:
pkg - the package name.
Throws: AccessControlException
if the caller does not have permission to define classes in the specified package.
See Also:
loadClass
 o checkSetFactory
public void checkSetFactory()
Throws an AccessControlException if the calling thread is not allowed to set the socket factory used by ServerSocket or Socket, or the stream handler factory used by URL.

The checkSetFactory method for class SecurityManager calls AccessController.checkPermission with the RuntimePermission("setFactory") permission.

Throws: AccessControlException
if the caller does not have permission to specify a socket factory or a stream handler factory.
See Also:
setSocketFactory, setSocketImplFactory, setURLStreamHandlerFactory
 o checkMemberAccess
public void checkMemberAccess(Class clazz,
                              int which)
Tests if a client is allowed to access members. If access is denied, throw a AccessControlException. The default policy is to allow access to PUBLIC members, as well as access to classes that have the same class loader as the caller. In all other cases call AccessController.checkPermission with the RuntimePermission("reflect.declared."+clazz.getName()) permission.

Throws: AccessControlException
if the caller does not have permission.
 o checkSecurityAccess
public void checkSecurityAccess(String action)
Tests access to certain operations for a security API action.

This method calls AccessController.checkPermission with the SecurityPermission(action) permission.

Parameters:
action - the security API action to check against.
 o getThreadGroup
public ThreadGroup getThreadGroup()
Returns the thread group into which to instantiate any new thread being created at the time this is being called. By default, it returns the thread group of the current thread. This should be overriden by a specific security manager to return the appropriate thread group.


All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature