All Packages Class Hierarchy This Package Previous Next Index
Class java.lang.SecurityManager
java.lang.Object
|
+----java.lang.SecurityManager
- public class SecurityManager
- extends Object
An abstract class that can be subclassed
to implement a security policy. It allows the inspection of
the classloaders on the execution stack.
-
inCheck
-
-
SecurityManager()
- Constructs a new SecurityManager.
-
checkAccept(String, int)
- Checks to see if a socket connection to the specified port on the
specified host has been accepted.
-
checkAccess(Thread)
- Checks to see if the specified Thread is allowed to modify
the Thread group.
-
checkAccess(ThreadGroup)
- Checks to see if the specified Thread group is allowed to
modify this group.
-
checkAwtEventQueueAccess()
- Checks to see if an client can get access to the AWT event queue.
-
checkConnect(String, int)
- Checks to see if a socket has connected to the specified port on the
the specified host.
-
checkConnect(String, int, Object)
- Checks to see if the current execution context and the indicated
execution context are both allowed to connect to the indicated
host and port.
-
checkCreateClassLoader()
- Checks to see if the ClassLoader has been created.
-
checkDelete(String)
- Checks to see if a file with the specified system dependent
file name can be deleted.
-
checkExec(String)
- Checks to see if the system command is executed by
trusted code.
-
checkExit(int)
- Checks to see if the system has exited the virtual
machine with an exit code.
-
checkLink(String)
- Checks to see if the specified linked library exists.
-
checkListen(int)
- Checks to see if a server socket is listening to the specified local
port that it is bounded to.
-
checkMemberAccess(Class, int)
- Check if a client is allowed to access members.
-
checkMulticast(InetAddress)
- Checks to see if current execution context is allowed to use
(join/leave/send/receive) IP multicast.
-
checkMulticast(InetAddress, byte)
- Checks to see if current execution context is allowed to use
(join/leave/send/receive) IP multicast.
-
checkPackageAccess(String)
- Checks to see if a client can access a package.
-
checkPackageDefinition(String)
- Checks to see if a client can define classes in a package.
-
checkPrintJobAccess()
- Checks to see if an client can initiate a print job request.
-
checkPropertiesAccess()
- Checks to see who has access to the System properties.
-
checkPropertyAccess(String)
- Checks to see who has access to the System property named by key.
-
checkRead(FileDescriptor)
- Checks to see if an input file with the specified
file descriptor object gets created.
-
checkRead(String)
- Checks to see if an input file with the specified system dependent
file name gets created.
-
checkRead(String, Object)
- Checks to see if the current context or the indicated context are
both allowed to read the given file name.
-
checkSecurityAccess(String)
-
Restrict access to certain operations to a given provider, for example, only a given provider (such as Sun) is able to retrieve the Sun provider properties.
-
checkSetFactory()
- Checks to see if a client can set a networking-related object factory.
-
checkSystemClipboardAccess()
- Checks to see if an client can get access to the System Clipboard.
-
checkTopLevelWindow(Object)
- Checks to see if top-level windows can be created by the
caller.
-
checkWrite(FileDescriptor)
- Checks to see if an output file with the specified
file descriptor object gets created.
-
checkWrite(String)
- Checks to see if an output file with the specified system dependent
file name gets created.
-
classDepth(String)
- Return the position of the stack frame containing the
first occurrence of the named class.
-
classLoaderDepth()
-
-
currentClassLoader()
- The current ClassLoader on the execution stack.
-
currentLoadedClass()
- The current Class with a ClassLoader on the execution stack.
-
getClassContext()
- Gets the context of this Class.
-
getInCheck()
-
Returns whether there is a security check in progress.
-
getSecurityContext()
- Returns an implementation-dependent Object which encapsulates
enough information about the current execution environment
to perform some of the security checks later.
-
getThreadGroup()
- Returns the thread group into which to instantiate any new
thread being created at the time this is being called.
-
inClass(String)
- Returns true if the specified String is in this Class.
-
inClassLoader()
- Returns a boolean indicating whether or not the current ClassLoader
is equal to null.
inCheck
protected boolean inCheck
SecurityManager
protected SecurityManager()
- Constructs a new SecurityManager.
- Throws: SecurityException
- If the security manager cannot be
created.
getInCheck
public boolean getInCheck()
- Returns whether there is a security check in progress.
getClassContext
protected Class[] getClassContext()
- Gets the context of this Class.
currentClassLoader
protected ClassLoader currentClassLoader()
- The current ClassLoader on the execution stack.
currentLoadedClass
protected Class currentLoadedClass()
- The current Class with a ClassLoader on the execution stack.
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
classLoaderDepth
protected int classLoaderDepth()
inClass
protected boolean inClass(String name)
- Returns true if the specified String is in this Class.
- Parameters:
- name - the name of the class
inClassLoader
protected boolean inClassLoader()
- Returns a boolean indicating whether or not the current ClassLoader
is equal to null.
getSecurityContext
public Object getSecurityContext()
- Returns an implementation-dependent Object which encapsulates
enough information about the current execution environment
to perform some of the security checks later.
checkCreateClassLoader
public void checkCreateClassLoader()
- Checks to see if the ClassLoader has been created.
- Throws: SecurityException
- If a security error has occurred.
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.
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.
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.
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.
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.
checkRead
public void checkRead(FileDescriptor fd)
- Checks to see if an input file with the specified
file descriptor object gets created.
- Parameters:
- fd - the system dependent file descriptor
- Throws: SecurityException
- If a security error has occurred.
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.
checkRead
public void checkRead(String file,
Object context)
- Checks to see if the current context or the indicated context are
both allowed to read the given file name.
- Parameters:
- file - the system dependent file name
- context - the alternate execution context which must also
be checked
- Throws: SecurityException
- If the file is not found.
checkWrite
public void checkWrite(FileDescriptor fd)
- Checks to see if an output file with the specified
file descriptor object gets created.
- Parameters:
- fd - the system dependent file descriptor
- Throws: SecurityException
- If a security error has occurred.
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 dependent file name
- Throws: SecurityException
- If the file is not found.
checkDelete
public void checkDelete(String file)
- Checks to see if a file with the specified system dependent
file name can be deleted.
- Parameters:
- file - the system dependent file name
- Throws: SecurityException
- If the file is not found.
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.
checkConnect
public void checkConnect(String host,
int port,
Object context)
- Checks to see if the current execution context and the indicated
execution context are both allowed to connect to the indicated
host and port.
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.
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.
checkMulticast
public void checkMulticast(InetAddress maddr)
- Checks to see if current execution context is allowed to use
(join/leave/send/receive) IP multicast.
- Parameters:
- multicast - internet group address to be used.
- Throws: SecurityException
- If a security error has occurred.
checkMulticast
public void checkMulticast(InetAddress maddr,
byte ttl)
- Checks to see if current execution context is allowed to use
(join/leave/send/receive) IP multicast.
- Parameters:
- multicast - internet group address to be used.
- ttl - value in use, if it is multicast send.
- Throws: SecurityException
- If a security error has occurred.
checkPropertiesAccess
public void checkPropertiesAccess()
- Checks to see who has access to the System properties.
- Throws: SecurityException
- If a security error has occurred.
checkPropertyAccess
public void checkPropertyAccess(String key)
- Checks to see who has access to the System property named by key.
- Parameters:
- key - the System property that the caller wants to examine
- Throws: SecurityException
- If a security error has occurred.
checkTopLevelWindow
public boolean checkTopLevelWindow(Object window)
- 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.
- Parameters:
- window - the new window that's being created.
checkPrintJobAccess
public void checkPrintJobAccess()
- Checks to see if an client can initiate a print job request.
checkSystemClipboardAccess
public void checkSystemClipboardAccess()
- Checks to see if an client can get access to the System Clipboard.
checkAwtEventQueueAccess
public void checkAwtEventQueueAccess()
- Checks to see if an client can get access to the AWT event queue.
checkPackageAccess
public void checkPackageAccess(String pkg)
- Checks to see if a client can access a package.
checkPackageDefinition
public void checkPackageDefinition(String pkg)
- Checks to see if a client can define classes in a package.
checkSetFactory
public void checkSetFactory()
- Checks to see if a client can set a networking-related object factory.
checkMemberAccess
public void checkMemberAccess(Class clazz,
int which)
- Check if a client is allowed to access members. If access is
denied, throw a SecurityException.
Default policy: all accesses denied.
checkSecurityAccess
public void checkSecurityAccess(String provider)
-
Restrict access to certain operations to a given provider,
for example, only a given provider (e.g. Sun) is able to
retrieve the Sun provider properties
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 specific security
manager to return the appropriate thread group.
All Packages Class Hierarchy This Package Previous Next Index