com.sun.javatest
Class JavaTestSecurityManager
java.lang.Object
java.lang.SecurityManager
com.sun.javatest.JavaTestSecurityManager
public class JavaTestSecurityManager
- extends java.lang.SecurityManager
This 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.
| Fields inherited from class java.lang.SecurityManager |
inCheck |
| Methods inherited from class java.lang.SecurityManager |
checkPermission, checkPermission, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, getThreadGroup, inClass, inClassLoader |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaTestSecurityManager
public JavaTestSecurityManager()
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:
checkAccept in class java.lang.SecurityManager
checkAccess
public void checkAccess(java.lang.Thread g)
- Overrides:
checkAccess in class java.lang.SecurityManager
checkAccess
public void checkAccess(java.lang.ThreadGroup g)
- Overrides:
checkAccess in class java.lang.SecurityManager
checkConnect
public void checkConnect(java.lang.String host,
int port)
- Overrides:
checkConnect in class java.lang.SecurityManager
checkConnect
public void checkConnect(java.lang.String host,
int port,
java.lang.Object context)
- Overrides:
checkConnect in class java.lang.SecurityManager
checkCreateClassLoader
public void checkCreateClassLoader()
- Overrides:
checkCreateClassLoader in class java.lang.SecurityManager
checkDelete
public void checkDelete(java.lang.String file)
- Overrides:
checkDelete in class java.lang.SecurityManager
checkExec
public void checkExec(java.lang.String cmd)
- Overrides:
checkExec in class java.lang.SecurityManager
checkExit
public void checkExit(int status)
- Overrides:
checkExit in class java.lang.SecurityManager
checkLink
public void checkLink(java.lang.String lib)
- Overrides:
checkLink in class java.lang.SecurityManager
checkListen
public void checkListen(int port)
- Overrides:
checkListen in class java.lang.SecurityManager
checkPackageAccess
public void checkPackageAccess(java.lang.String pkg)
- Overrides:
checkPackageAccess in class java.lang.SecurityManager
checkPackageDefinition
public void checkPackageDefinition(java.lang.String pkg)
- Overrides:
checkPackageDefinition in class java.lang.SecurityManager
checkPropertiesAccess
public void checkPropertiesAccess()
- Overrides:
checkPropertiesAccess in class java.lang.SecurityManager
checkPropertyAccess
public void checkPropertyAccess(java.lang.String key)
- Overrides:
checkPropertyAccess in class java.lang.SecurityManager
checkRead
public void checkRead(java.io.FileDescriptor fd)
- Overrides:
checkRead in class java.lang.SecurityManager
checkRead
public void checkRead(java.lang.String file)
- Overrides:
checkRead in class java.lang.SecurityManager
checkRead
public void checkRead(java.lang.String file,
java.lang.Object context)
- Overrides:
checkRead in class java.lang.SecurityManager
checkSetFactory
public void checkSetFactory()
- Overrides:
checkSetFactory in class java.lang.SecurityManager
checkTopLevelWindow
public boolean checkTopLevelWindow(java.lang.Object window)
- Overrides:
checkTopLevelWindow in class java.lang.SecurityManager
checkWrite
public void checkWrite(java.io.FileDescriptor fd)
- Overrides:
checkWrite in class java.lang.SecurityManager
checkWrite
public void checkWrite(java.lang.String file)
- Overrides:
checkWrite in class java.lang.SecurityManager
checkAwtEventQueueAccess
public void checkAwtEventQueueAccess()
- Overrides:
checkAwtEventQueueAccess in class java.lang.SecurityManager
checkMemberAccess
public void checkMemberAccess(java.lang.Class clazz,
int which)
- Overrides:
checkMemberAccess in class java.lang.SecurityManager
checkMulticast
public void checkMulticast(java.net.InetAddress maddr)
- Overrides:
checkMulticast in class java.lang.SecurityManager
checkMulticast
public void checkMulticast(java.net.InetAddress maddr,
byte ttl)
- Overrides:
checkMulticast in class java.lang.SecurityManager
checkPrintJobAccess
public void checkPrintJobAccess()
- Overrides:
checkPrintJobAccess in class java.lang.SecurityManager
checkSecurityAccess
public void checkSecurityAccess(java.lang.String provider)
- Overrides:
checkSecurityAccess in class java.lang.SecurityManager
checkSystemClipboardAccess
public void checkSystemClipboardAccess()
- Overrides:
checkSystemClipboardAccess in class java.lang.SecurityManager
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
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.