Package com.sun.javatest
Class JavaTestSecurityManager
java.lang.Object
java.lang.SecurityManager
com.sun.javatest.JavaTestSecurityManager
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkAccept
(String host, int port) void
void
void
Deprecated.void
checkConnect
(String host, int port) void
checkConnect
(String host, int port, Object context) void
void
checkDelete
(String file) void
void
checkExit
(int status) void
void
checkListen
(int port) void
checkMemberAccess
(Class<?> clazz, int which) Deprecated.void
checkMulticast
(InetAddress maddr) void
checkMulticast
(InetAddress maddr, byte ttl) void
checkPackageAccess
(String pkg) void
void
void
void
void
void
void
void
checkSecurityAccess
(String provider) void
void
Deprecated.boolean
checkTopLevelWindow
(Object window) Deprecated.void
void
checkWrite
(String file) static void
install()
Please note that the new default behaviour is NOT installing JavaTestSecurityManager.static boolean
setAllowExit
(boolean bool) Set whether or not the JVM may be exited.boolean
setAllowPropertiesAccess
(boolean bool) Set whether or not the set of system properties may be accessed.Methods inherited from class java.lang.SecurityManager
checkPermission, checkPermission, getClassContext, getSecurityContext, getThreadGroup
-
Constructor Details
-
JavaTestSecurityManager
public JavaTestSecurityManager()
-
-
Method Details
-
install
public static void install()Please note that the new default behaviour is NOT installing JavaTestSecurityManager. This method would try to install a copy of this security manager only if "javatest.security.noSecurityManager" property is set to something else than 'true' (ignoring case). If "javatest.security.noSecurityManager" is not defined, security manager still would not be installed. The install can be enabled by setting system property "javatest.security.noSecurityManager" to 'false'. If another security manager is already installed, the install will fail; a warning message will be written to the console if the previously installed security manager is not a subtype of com.sun.javatest.JavaTestSecurityManager. -
checkAccept
- Overrides:
checkAccept
in classSecurityManager
-
checkAccess
- Overrides:
checkAccess
in classSecurityManager
-
checkAccess
- Overrides:
checkAccess
in classSecurityManager
-
checkConnect
- Overrides:
checkConnect
in classSecurityManager
-
checkConnect
- Overrides:
checkConnect
in classSecurityManager
-
checkCreateClassLoader
public void checkCreateClassLoader()- Overrides:
checkCreateClassLoader
in classSecurityManager
-
checkDelete
- Overrides:
checkDelete
in classSecurityManager
-
checkExec
- Overrides:
checkExec
in classSecurityManager
-
checkExit
public void checkExit(int status) - Overrides:
checkExit
in classSecurityManager
-
checkLink
- Overrides:
checkLink
in classSecurityManager
-
checkListen
public void checkListen(int port) - Overrides:
checkListen
in classSecurityManager
-
checkPackageAccess
- Overrides:
checkPackageAccess
in classSecurityManager
-
checkPackageDefinition
- Overrides:
checkPackageDefinition
in classSecurityManager
-
checkPropertiesAccess
public void checkPropertiesAccess()- Overrides:
checkPropertiesAccess
in classSecurityManager
-
checkPropertyAccess
- Overrides:
checkPropertyAccess
in classSecurityManager
-
checkRead
- Overrides:
checkRead
in classSecurityManager
-
checkRead
- Overrides:
checkRead
in classSecurityManager
-
checkRead
- Overrides:
checkRead
in classSecurityManager
-
checkSetFactory
public void checkSetFactory()- Overrides:
checkSetFactory
in classSecurityManager
-
checkTopLevelWindow
Deprecated.Still temporarily kept for compatibility with JDK7, the overridden methods are deprecated in SE8 and removed in SE11 -
checkWrite
- Overrides:
checkWrite
in classSecurityManager
-
checkWrite
- Overrides:
checkWrite
in classSecurityManager
-
checkAwtEventQueueAccess
Deprecated.Still temporarily kept for compatibility with JDK7, the overridden methods are deprecated in SE8 and removed in SE11 -
checkMemberAccess
Deprecated.Still temporarily kept for compatibility with JDK7, the overridden methods are deprecated in SE8 and removed in SE11 -
checkMulticast
- Overrides:
checkMulticast
in classSecurityManager
-
checkMulticast
- Overrides:
checkMulticast
in classSecurityManager
-
checkPrintJobAccess
public void checkPrintJobAccess()- Overrides:
checkPrintJobAccess
in classSecurityManager
-
checkSecurityAccess
- Overrides:
checkSecurityAccess
in classSecurityManager
-
checkSystemClipboardAccess
Deprecated.Still temporarily kept for compatibility with JDK7, the overridden methods are deprecated in SE8 and removed in SE11 -
setAllowExit
public static 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
-