Package com.sun.javatest
Class JavaTestSecurityManager
- java.lang.Object
-
- java.lang.SecurityManager
-
- com.sun.javatest.JavaTestSecurityManager
-
public class JavaTestSecurityManager extends java.lang.SecurityManagerThis class is set for JT Harness running as an application. Currently, it imposes almost no security restrictions at all: its existence prevents anyone else (e.g. a test running in this JVM) from setting a more restrictive security manager. Although not required for running under JDK1.0.2, extra definitions for forward compatibility with JDK1.1 are also provided. They will effectively be ignored by JDK1.0.2.
-
-
Constructor Summary
Constructors Constructor Description JavaTestSecurityManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAccept(java.lang.String host, int port)voidcheckAccess(java.lang.Thread g)voidcheckAccess(java.lang.ThreadGroup g)voidcheckAwtEventQueueAccess()voidcheckConnect(java.lang.String host, int port)voidcheckConnect(java.lang.String host, int port, java.lang.Object context)voidcheckCreateClassLoader()voidcheckDelete(java.lang.String file)voidcheckExec(java.lang.String cmd)voidcheckExit(int status)voidcheckLink(java.lang.String lib)voidcheckListen(int port)voidcheckMemberAccess(java.lang.Class clazz, int which)voidcheckMulticast(java.net.InetAddress maddr)voidcheckMulticast(java.net.InetAddress maddr, byte ttl)voidcheckPackageAccess(java.lang.String pkg)voidcheckPackageDefinition(java.lang.String pkg)voidcheckPrintJobAccess()voidcheckPropertiesAccess()voidcheckPropertyAccess(java.lang.String key)voidcheckRead(java.io.FileDescriptor fd)voidcheckRead(java.lang.String file)voidcheckRead(java.lang.String file, java.lang.Object context)voidcheckSecurityAccess(java.lang.String provider)voidcheckSetFactory()voidcheckSystemClipboardAccess()booleancheckTopLevelWindow(java.lang.Object window)voidcheckWrite(java.io.FileDescriptor fd)voidcheckWrite(java.lang.String file)static voidinstall()Try to install a copy of this security manager.booleansetAllowExit(boolean bool)Set whether or not the JVM may be exited.booleansetAllowPropertiesAccess(boolean bool)Set whether or not the set of system properties may be accessed.
-
-
-
Method Detail
-
install
public static void install()
Try to install a copy of this security manager. If another security manager is already installed, the install will fail; a warning message wil, be written to the console if the previously installed security manager is not a subtype of com.sun.javatest.JavaTestSecurityManager. The install can be suppressed by setting the system property "javatest.security.noSecurityManager" to true.
-
checkAccept
public void checkAccept(java.lang.String host, int port)- Overrides:
checkAcceptin classjava.lang.SecurityManager
-
checkAccess
public void checkAccess(java.lang.Thread g)
- Overrides:
checkAccessin classjava.lang.SecurityManager
-
checkAccess
public void checkAccess(java.lang.ThreadGroup g)
- Overrides:
checkAccessin classjava.lang.SecurityManager
-
checkConnect
public void checkConnect(java.lang.String host, int port)- Overrides:
checkConnectin classjava.lang.SecurityManager
-
checkConnect
public void checkConnect(java.lang.String host, int port, java.lang.Object context)- Overrides:
checkConnectin classjava.lang.SecurityManager
-
checkCreateClassLoader
public void checkCreateClassLoader()
- Overrides:
checkCreateClassLoaderin classjava.lang.SecurityManager
-
checkDelete
public void checkDelete(java.lang.String file)
- Overrides:
checkDeletein classjava.lang.SecurityManager
-
checkExec
public void checkExec(java.lang.String cmd)
- Overrides:
checkExecin classjava.lang.SecurityManager
-
checkExit
public void checkExit(int status)
- Overrides:
checkExitin classjava.lang.SecurityManager
-
checkLink
public void checkLink(java.lang.String lib)
- Overrides:
checkLinkin classjava.lang.SecurityManager
-
checkListen
public void checkListen(int port)
- Overrides:
checkListenin classjava.lang.SecurityManager
-
checkPackageAccess
public void checkPackageAccess(java.lang.String pkg)
- Overrides:
checkPackageAccessin classjava.lang.SecurityManager
-
checkPackageDefinition
public void checkPackageDefinition(java.lang.String pkg)
- Overrides:
checkPackageDefinitionin classjava.lang.SecurityManager
-
checkPropertiesAccess
public void checkPropertiesAccess()
- Overrides:
checkPropertiesAccessin classjava.lang.SecurityManager
-
checkPropertyAccess
public void checkPropertyAccess(java.lang.String key)
- Overrides:
checkPropertyAccessin classjava.lang.SecurityManager
-
checkRead
public void checkRead(java.io.FileDescriptor fd)
- Overrides:
checkReadin classjava.lang.SecurityManager
-
checkRead
public void checkRead(java.lang.String file)
- Overrides:
checkReadin classjava.lang.SecurityManager
-
checkRead
public void checkRead(java.lang.String file, java.lang.Object context)- Overrides:
checkReadin classjava.lang.SecurityManager
-
checkSetFactory
public void checkSetFactory()
- Overrides:
checkSetFactoryin classjava.lang.SecurityManager
-
checkTopLevelWindow
public boolean checkTopLevelWindow(java.lang.Object window)
-
checkWrite
public void checkWrite(java.io.FileDescriptor fd)
- Overrides:
checkWritein classjava.lang.SecurityManager
-
checkWrite
public void checkWrite(java.lang.String file)
- Overrides:
checkWritein classjava.lang.SecurityManager
-
checkAwtEventQueueAccess
public void checkAwtEventQueueAccess()
-
checkMemberAccess
public void checkMemberAccess(java.lang.Class clazz, int which)
-
checkMulticast
public void checkMulticast(java.net.InetAddress maddr)
- Overrides:
checkMulticastin classjava.lang.SecurityManager
-
checkMulticast
public void checkMulticast(java.net.InetAddress maddr, byte ttl)- Overrides:
checkMulticastin classjava.lang.SecurityManager
-
checkPrintJobAccess
public void checkPrintJobAccess()
- Overrides:
checkPrintJobAccessin classjava.lang.SecurityManager
-
checkSecurityAccess
public void checkSecurityAccess(java.lang.String provider)
- Overrides:
checkSecurityAccessin classjava.lang.SecurityManager
-
checkSystemClipboardAccess
public void checkSystemClipboardAccess()
-
setAllowExit
public boolean setAllowExit(boolean bool)
Set whether or not the JVM may be exited. The default value is "false".- Parameters:
bool- true if the JVM may be exited, and false otherwise- Returns:
- the previous value of this setting
-
setAllowPropertiesAccess
public boolean setAllowPropertiesAccess(boolean bool)
Set whether or not the set of system properties may be accessed. The default value is determined by the system property "javatest.security.allowPropertiesAccess".- Parameters:
bool- true if the system properties may be accessed, and false otherwise- Returns:
- the previous value of this setting
-
-