|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.SecurityManager
An abstract class that can be subclassed to implement a security policy. It allows the inspection of the classloaders on the execution stack.
Field Summary | |
protected boolean |
inCheck
|
Constructor Summary | |
protected |
SecurityManager()
Constructs a new SecurityManager. |
Method Summary | |
void |
checkAccept(String host,
int port)
Checks to see if a socket connection to the specified port on the specified host has been accepted. |
void |
checkAccess(Thread g)
Checks to see if the specified Thread is allowed to modify the Thread group. |
void |
checkAccess(ThreadGroup g)
Checks to see if the specified Thread group is allowed to modify this group. |
void |
checkConnect(String host,
int port)
Checks to see if a socket has connected to the specified port on the the specified host. |
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. |
void |
checkCreateClassLoader()
Checks to see if the ClassLoader has been created. |
void |
checkDelete(String file)
Checks to see if a file with the specified system dependent file name can be deleted. |
void |
checkExec(String cmd)
Checks to see if the system command is executed by trusted code. |
void |
checkExit(int status)
Checks to see if the system has exited the virtual machine with an exit code. |
void |
checkLink(String lib)
Checks to see if the specified linked library exists. |
void |
checkListen(int port)
Checks to see if a server socket is listening to the specified local port that it is bounded to. |
void |
checkPackageAccess(String pkg)
Checks to see if an applet can access a package. |
void |
checkPackageDefinition(String pkg)
Checks to see if an applet can define classes in a package. |
void |
checkPropertiesAccess()
Checks to see who has access to the System properties. |
void |
checkPropertyAccess(String key)
Checks to see who has access to the System property named by key. |
void |
checkPropertyAccess(String key,
String def)
Checks to see who has access to the System property named by key and def. |
void |
checkRead(FileDescriptor fd)
Checks to see if an input file with the specified file descriptor object gets created. |
void |
checkRead(String file)
Checks to see if an input file with the specified system dependent file name gets created. |
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. |
void |
checkSetFactory()
Checks to see if an applet can set a networking-related object factory. |
boolean |
checkTopLevelWindow(Object window)
Checks to see if top-level windows can be created by the caller. |
void |
checkWrite(FileDescriptor fd)
Checks to see if an output file with the specified file descriptor object gets created. |
void |
checkWrite(String file)
Checks to see if an output file with the specified system dependent file name gets created. |
protected int |
classDepth(String name)
Return the position of the stack frame containing the first occurrence of the named class. |
protected int |
classLoaderDepth()
|
protected ClassLoader |
currentClassLoader()
The current ClassLoader on the execution stack. |
protected Class[] |
getClassContext()
Gets the context of this Class. |
boolean |
getInCheck()
Returns whether there is a security check in progress. |
Object |
getSecurityContext()
Returns an implementation-dependent Object which encapsulates enough information about the current execution environment to perform some of the security checks later. |
protected boolean |
inClass(String name)
Returns true if the specified String is in this Class. |
protected boolean |
inClassLoader()
Returns a boolean indicating whether or not the current ClassLoader is equal to null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean inCheck
Constructor Detail |
protected SecurityManager()
SecurityException
- If the security manager cannot be
created.Method Detail |
public boolean getInCheck()
protected Class[] getClassContext()
protected ClassLoader currentClassLoader()
protected int classDepth(String name)
name
- classname of the class to search forprotected int classLoaderDepth()
protected boolean inClass(String name)
name
- the name of the classprotected boolean inClassLoader()
public Object getSecurityContext()
public void checkCreateClassLoader()
SecurityException
- If a security error has occurred.public void checkAccess(Thread g)
g
- the Thread to be checked
SecurityException
- If the current Thread is not
allowed to access this Thread group.public void checkAccess(ThreadGroup g)
g
- the Thread group to be checked
SecurityException
- If the current Thread group is
not allowed to access this Thread group.public void checkExit(int status)
status
- exit status, 0 if successful, other values
indicate various error types.
SecurityException
- If a security error has occurred.public void checkExec(String cmd)
cmd
- the specified system command
SecurityException
- If a security error has occurred.public void checkLink(String lib)
lib
- the name of the library
SecurityException
- If the library does not exist.public void checkRead(FileDescriptor fd)
fd
- the system dependent file descriptor
SecurityException
- If a security error has occurred.public void checkRead(String file)
file
- the system dependent file name
SecurityException
- If the file is not found.public void checkRead(String file, Object context)
file
- the system dependent file namecontext
- the alternate execution context which must also
be checked
SecurityException
- If the file is not found.public void checkWrite(FileDescriptor fd)
fd
- the system dependent file descriptor
SecurityException
- If a security error has occurred.public void checkWrite(String file)
file
- the system dependent file name
SecurityException
- If the file is not found.public void checkDelete(String file)
file
- the system dependent file name
SecurityException
- If the file is not found.public void checkConnect(String host, int port)
host
- the host name port to connect toport
- the protocol port to connect to
SecurityException
- If a security error has occurred.public void checkConnect(String host, int port, Object context)
public void checkListen(int port)
port
- the protocol port to connect to
SecurityException
- If a security error has occurred.public void checkAccept(String host, int port)
host
- the host name to connect toport
- the protocol port to connect to
SecurityException
- If a security error has occurred.public void checkPropertiesAccess()
SecurityException
- If a security error has occurred.public void checkPropertyAccess(String key)
key
- the System property that the caller wants to examine
SecurityException
- If a security error has occurred.public void checkPropertyAccess(String key, String def)
key
- the System property that the caller wants to examinedef
- default value to return if this property is not defined
SecurityException
- If a security error has occurred.public boolean checkTopLevelWindow(Object window)
window
- the new window that's being created.public void checkPackageAccess(String pkg)
public void checkPackageDefinition(String pkg)
public void checkSetFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |