public class BlockExitSecurityManager
extends SecurityManager
| Constructor and Description |
|---|
BlockExitSecurityManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
blockSystemExitCalls()
Blocks System.exit() calls from exiting the JVM and instead throws a
SecurityException in its place. |
void |
checkExit(int status) |
void |
checkPermission(Permission p) |
checkAccept, checkAccess, checkAccess, checkAwtEventQueueAccess, checkConnect, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkTopLevelWindow, checkWrite, checkWrite, getInCheck, getSecurityContext, getThreadGrouppublic void checkExit(int status)
checkExit in class SecurityManagerpublic void checkPermission(Permission p)
checkPermission in class SecurityManagerpublic static void blockSystemExitCalls()
SecurityException in its place. This is useful when running a JVM through an
interactive interpreter such as Python so that individual commands to not cause the REPL
to exit. This will generate a WARNING message in Java 17, and must be explicitly allowed in
future JDK releases.